文章

71

粉丝

97

获赞

5

访问

18.0k

头像
p1240首字母大写 为什么通过率80%
我要提问
发布于2024年1月22日 20:29
阅读数 367

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <string.h>
#include <string>
using namespace std;

char s[1005];
int main(){
    while(gets(s)){
    int flag=1;
    int length=strlen(s);
    for(int i=0;i<length;i++){
        if(flag==1&&s[i]!=' '&&s[i] == '\n' && s[i] == '\t' && s[i] =='\r'){
            if(s[i]>='a'&&s[i]<='z')
                s[i]-=32;
            flag=0;
        }else if(s[i] == ' ' || s[i] == '\n' || s[i] == '\t' || s[i] =='\r'){
          ...

登录查看完整内容


登录后发布评论

1 条评论
快乐小土狗
2024年1月22日 22:32

把else if的else去掉

赞(0)