题解 | #判断是元音还是辅音#
判断是元音还是辅音
https://www.nowcoder.com/practice/7eb4df4d52c44d309081509cf52ecbc4
#include <stdio.h> int main() { char ch; char array[] = {'A','E','O','U','a','e','o','u','I','i'}; int sz = sizeof(array) / sizeof(array[0]); int i = 0; while (~scanf(" %c", &ch)) { for (i = 0; i < sz; i++) { if (ch == array[i]) { printf("Vowel\n"); break; } } if (i == sz) { printf("Consonant\n"); } } return 0; }