不知道这个代码有啥问题,为啥运行时间超限
#include<stdio.h>int main()
{
int chara = 0, num = 0, space = 0, other = 0;
int ch;
ch = getchar();
while (ch != '\n')
{
if (ch>= 'A' && ch<= 'Z'||ch>='a'&&ch<='z')
{
chara++;
}
else if (ch>= '0' && ch<= '9')
{
num++;
}
else if (ch == ' ')
{
space++;
}
else
other++;
}
printf("%d %d %d %d\n", chara, num, space, other);
return 0;
}