#include<stdio.h>
int main()
{
int capital=0,lowercase=0,num=0,blank=0,other=0;
char input;
while((input=getchar())!='\n')
{
if(input>'a'&&input<'z')
lowercase++;
else if(input>'A'&&input<'Z')
capital++;
else if(input==' ')
blank++;
else if(input>'0'&&input<'9')
num++;
else other++;
}
printf("capital%d lowercase%d blank%d number%d other%d",capital,lowercase,blank,num,other);
return 0;
}
2.1统计输入字符中各个类型的数目
最新推荐文章于 2022-06-29 15:48:29 发布