在线编译器 C

#include <stdio.h> int is_vowel(char c){ return c=='a'||c=='e'||c=="i"||c=='o'||c=='u'||c=='y' }; int main() { char s[201]; scanf("%s", &s); int count=0; for (int i = 0;s[i]!='\0'; i++) { if (is_vowel(s[i])){ count++; } } printf("%d\n", count); return 0; }
The code reads a string and counts how many vowels it contains, but it has a few mistakes that prevent it from working correctly.

- In the `is_vowel` function, you compare `c` with `"i"` using double quotes, but `"i"` is a string literal, not a single character. Use single quotes for character comparisons.
- The `is_vowel` function definition ends with a semicolon after the closing brace, which is incorrect syntax. Remove that semicolon.