这题是抽的,,,
#include <stdio.h>
int main(){
char c;
int letters=0,
blank=0,
digit=0,
others=0;
printf("Input a string:");
while((c=getchar())!='\n'){
if(c>='a'&&c<='z'||c>='A'&&c<='Z')
letters++;
else if(c==' ')
blank++;
else if(c>='0'&&c<='9')
digit++;
else
others++;
}
printf("letter=%d,blank=%d,digit=%d,other=%d\n", letters,blank, digit, others);
return 0;
}
有个小问题,跑是可以跑,但是交上去系统不认。