- 题解
标题统计题解
- @ 2023-7-20 10:03:46
#include<bits/stdc++.h>
using namespace std;
char s[8];//定义一个数组
int main(){
int ans=0;//字符数的计数器
gets(s);//输入字符数组s
for(int i=0;i<strlen(s);i++){
if(s[i]!=' '&&s[i]!='\n'){
ans++; //如果s[i]不是空格或换行,就给字符数的计数器加1
}
}
cout<<ans<<endl;//输出字符数
}
3 条评论
-
董的都懂 @ 2023-7-20 11:26:40666
-
@ 2023-7-20 10:07:38谢谢
-
@ 2023-7-20 10:05:15999999986666696996969696599696996969699696969969797999979699696969969696969696
- 1