#include
int main()
{
int letters=0,spaces=0,numbers=0,others=0;
char c;
while((c=getchar())!='\n');
{
if(((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
{
letters+=1;
}
else if(c==' ')
{
spaces+=1;
}
else if(c>='0'&&c<='9')
{
numbers+=1;
}
else
{
others+=1;
}
}
printf("%d %d %d %d",letters,spaces,numbers,others);
return 0;
}
編譯是通過的,但運行結果是0 0 0 1,隨便什麼輸入都這樣
while後面多了個分號