参考下面的代码:
#include<stdio.h>
int main()
{
char c;
int num=0,lett=0,bar=0,others=0;
scanf("%c",&c);
while(c!='#')
{
if(c==' ') bar++;
else if(c>='0'&&c<='9') num++;
else if(c>='a'&&c<='z' || c>='A'&&c<='Z') lett++;
else others++;
scanf("%c",&c);
}
return 0;
}
匿名回答于2020-08-10 19:11:37