#include <stdio.h> #include <stdlib.h> int main() { int num_a=0,num_1=0,num_=0,num_other=0; char c; while((c=getchar())!='\n'){ if((c>='a'&&c<='z')||(c>='A'&&c<='Z')){ num_a++; }else if(c>='0'&&c<='9'){ num_1++; }else if(c==' '){ num_++; }else{ num_other+=1; } } printf("%d\n%d\n%d\n%d",num_a,num_,num_1,num_other); return 0; }
1009: C基础-统计字符
最新推荐文章于 2023-04-11 17:53:19 发布