一个简单程序,但就是找不出哪里出了问题,求大神帮忙看下
#include<stdio.h>int main (void)
{
char ch;
scanf("%s",ch);
int i,a=0,b=0,c=0,d=0,e=0,f;
for(i=0;ch!='\0';i++)
{
if(ch=='a'||ch=='A') a++;
else if(ch='e'||ch=='E') b++;
else if(ch='i'||ch=='I') c++;
else if(ch='o'||ch=='O') d++;
else if(ch='u'||ch=='U') e++;
}
f=a+b+c+d+e;
printf("您输入的句子中,包含元音字母%d个!\n",f);
printf("其中:a(%d),e(%d),i(%d),o(%d),u(%d)\n",a,b,c,d,e);
return 0;
} how silly you are!!!!!!!!!
else if(ch='e'||ch=='E') b++;你前面写的是= !!是赋值号!! Krant5 发表于 2016-10-18 10:15
how silly you are!!!!!!!!!
else if(ch='e'||ch=='E') b++;你前面写的是= !!是赋值号!!
谢谢 。。。我都要羞愧死了 哇! 看到代码 精神多了
页:
[1]