#include <stdio.h>
#include <stdlib.h>
#include<string.h>、
int main()
{
int count_num = 0,count_char = 0,count_k = 0,count_other = 0,i,length;
char s[1000];
gets(s);
length = strlen(s);
for(i = 0;i<length;i++)
{
if(s[i]>='0'&&s[i]<='9')
count_num++;
if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z')
count_char++;
if(s[i]==' ')
count_k++;
}
count_other = length-count_num-count_char-count_k;
printf("%d%d%d%d",count_char,count_num,count_k,count_other);
system("pause");
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:685 |
点我有惊喜!你懂得!浏览:1418 |
C语言训练-计算1977!* (C语言代码)浏览:941 |
C二级辅导-统计字符 (C语言代码)浏览:577 |
C二级辅导-计负均正 (C语言代码)浏览:556 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:387 |
大神老白 (C语言代码)浏览:690 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:606 |
WU-输出九九乘法表 (C++代码)浏览:1853 |
WU-C语言程序设计教程(第三版)课后习题11.12 (C++代码)(想学链表的小伙伴可以看看)浏览:964 |