#include <stdio.h>
int main(){
char consonant[21]={'B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'};
char result[81];
int i=0;
int count=0;
char c;
while (i < 80 && scanf("%c", &c) == 1 && c != '\n') {
result[i++] = c;
}
for (int k=0;k<i;k++){
for (int j=0;j<21;j++){
if (result[k] == consonant[j]){count++;break;}
}
}
printf("%d",count);
return 0;
}
代码来自:https://yunjinqi.top/article/189