一道c语言题,找出一句话中元音个数,大家帮忙看看(基础题)
#include <ctype.h>#include <stdio.h>
int main(void)
{
int a,b;
char ch;
printf("Enter a sentence:");
ch=getchar();
ch=toupper(ch);
for(b=0;ch=='\n';)
{
ch=getchar();
ch=toupper(ch);
{
if(ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U')
a=1;
else
a=0;
}
b+=a;
}
printf("Your sentence contains %d vowels\n",b);
}