解题思路:
ctype头文件
注意事项:
参考代码:
#include <stdio.h>
#include <ctype.h>
int main(void)
{
char ch;int a=0,b=0,c=0,d=0;
while((ch=getchar())!='\n')
{
if(isalpha(ch))
a++;
else if(isdigit(ch))
b++;
else if(ch==' ')
c++;
else
d++;
}printf("%d %d %d %d",a,b,c,d);
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:326 |
C语言训练-亲密数 (C语言代码)浏览:682 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:588 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:509 |
震宇大神的杀毒软件 (C语言代码)浏览:1079 |
C语言训练-自守数问题 (C语言代码)浏览:742 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:740 |
C语言程序设计教程(第三版)课后习题9.10 (C语言代码)浏览:620 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:728 |
1199题解浏览:656 |