#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语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:605 |
汽水瓶 (C语言代码)浏览:659 |
九宫重排 (C++代码)浏览:1409 |
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:906 |
【回文数(二)】 (C语言代码)浏览:799 |
【亲和数】 (C语言代码)浏览:528 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:780 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:571 |
矩阵加法 (C语言代码)浏览:1764 |
DNA (C语言代码)浏览:797 |