【C】#判断是元音还是辅音#
判断是元音还是辅音
https://www.nowcoder.com/practice/7eb4df4d52c44d309081509cf52ecbc4
#include <stdio.h> #include <string.h> int main() { char arr[] = "AEIOUaeiou"; char letter; while (scanf("%c", &letter) != EOF) { if (strchr(arr, letter)) { printf("Vowel\n"); getchar(); } else { printf("Consonant\n"); getchar(); } } return 0; }