c语言编程:输入一行字符,分别统计出其中英文字母,空格,数字和其他字符的个数,用while语句~~谢谢
c语言编程:输入一行字符,分别统计出其中英文字母,空格,数字和其他字符的个数,用while语句~~谢谢
日期:2020-04-22 11:17:22 人气:2
#include
int main()
{
int i=0, space=0, num=0, n=0, ch=0;
char s[20];
printf("请输入一串字符 ");
gets(s);
while(s[i] != '\0')
{
if(s[i]==' ')
space++;
else if(s[i]='0')
num++;
else if(s[i]='a' || s[i]='A')
c