题解 | #判断是元音还是辅音#
判断是元音还是辅音
https://www.nowcoder.com/practice/7eb4df4d52c44d309081509cf52ecbc4
#include<stdio.h> int main() { char ch; char a[] = "AaEeIiOoUu"; while((ch=getchar())!=EOF) { int a=0; //每一次都要让a=0 for(int i=0;i<10;i++) { if(ch == a[i]) { a=1; break; } } if(a==1) { printf("Vowel\n"); } else { printf("Consonant\n"); } getchar(); //清理掉\n } return 0; }