English consonants is in addition to A
, E
, I
, O
, U
other than letters. This question requires programming, statistics given string in uppercase number of consonants.
Input formats:
Does not exceed a given input string of 80 characters, and a carriage return at the end of a row.
Output formats:
The number of consonants uppercase character string given in the output line.
Sample input:
HELLO World!
Sample output:
4
answer:
#include<stdio.h>
#include<string.h>
int main(){
int cnt=0;
char s[85];
scanf("%[^\n]",&s);
int len=strlen(s);
for(int i=0;i<len;i++){
if(s[i]>='B'&&s[i]<='Z'&&s[i]!='E'&&s[i]!='I'&&s[i]!='O'&&s[i]!='U') cnt++;
}
printf("%d",cnt);
}