解题思路:
注意事项:
参考代码:
#include<stdio.h>
int main()
{
char c;
int a,b,d,e;
a=b=d=e=0;
while((c=getchar())!='\n')
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {a++;}
else if(c==' ') {b++;}
else if(c>='0'&&c<='9') {e++;}
else {d++;}
}
printf("%d\n%d\n%d\n%d\n",a,b,e,d);
return 0;
}
0.0分
0 人评分
数字整除 (C++代码)——(22行代码)真的只需要两个变量就够了浏览:1829 |
简洁的代码浏览:1436 |
点我有惊喜!你懂得!浏览:2228 |
C语言训练-谁家孩子跑最慢* (C语言代码)浏览:1521 |
C语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:627 |
数组输出 (C语言代码)浏览:795 |
简单的a+b (C语言代码)浏览:755 |
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:592 |
【出圈】 (C语言代码)浏览:812 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:475 |