解题思路:
注意事项:
参考代码:
#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++代码)浏览:1212 |
C语言训练-舍罕王的失算 (C语言代码)浏览:1033 |
陶陶摘苹果 (C语言代码)浏览:1606 |
模拟计算器 (C语言代码)浏览:891 |
【出圈】 (C语言代码)浏览:558 |
人见人爱A+B (C语言代码)浏览:628 |
简单的a+b (C语言代码)浏览:530 |
简单的a+b (C语言代码)浏览:817 |
完数 (C语言代码)浏览:693 |
母牛的故事 (C语言代码)浏览:551 |