當前位置:股票大全官網 - 財經資訊 - 輸入壹個以回車結束的字符串(少於80個字符),統計並輸出其中大寫輔音字母的個數。大寫輔音字母:除'A',

輸入壹個以回車結束的字符串(少於80個字符),統計並輸出其中大寫輔音字母的個數。大寫輔音字母:除'A',

#include<stdio.h>

main()

{

char s[100];

int i,n=0;

gets(s);

for(i=0;i<strlen(s);i++)

if(s[i]>='B'&&s[i]<='Z'&&s[i]!='E'&&s[i]!='I'&&s[i]!='O'&&s[i]!='U')n++;

printf("%d\n",n);

}