课后作业,求最小值等题目答案
#include <stdio.h>
int main()
{
int letter=0,blank=0,digit=0,other=0;
char c;
while((c=getchar())!='\n'){
if(c==' ')
blank++;
else if(c>='0'&&c<='9')
digit++;
else if((c>='a'&&c<='z')||c>='A'&&c<='Z')
letter++;
else other++;
}
printf("letter=%d, blank=%d, digit=%d, other=%d\n",letter,blank,digit,other);
return 0;
}
、