主题:救急!!!
#include "stdafx.h"
#include <stdio.h>
int main(int argc, char* argv[])
{int letter,digit,space,other,i;
char s[20];
for(i=0;i<20;i++)
scanf("%s",s[i]);
for(i=0;i<20;i++)
{ [color=800000]if('a'<=s[i]<='z'&&'A'<=s[i]<='Z')[/color]
letter++;
if([color=800080]1<=s[i]<=9)[/color]
digit++;
if(s[i]=' ')
space++;
else other++;
}
printf("字母有%d个,数字有%d个,空格有%d个,其他有%d个\n",letter,digit,space,other);
return 0;
}
#include <stdio.h>
int main(int argc, char* argv[])
{int letter,digit,space,other,i;
char s[20];
for(i=0;i<20;i++)
scanf("%s",s[i]);
for(i=0;i<20;i++)
{ [color=800000]if('a'<=s[i]<='z'&&'A'<=s[i]<='Z')[/color]
letter++;
if([color=800080]1<=s[i]<=9)[/color]
digit++;
if(s[i]=' ')
space++;
else other++;
}
printf("字母有%d个,数字有%d个,空格有%d个,其他有%d个\n",letter,digit,space,other);
return 0;
}