50132. Only Consonants

難度:2/5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

static inline int is_vowel(char c){
return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}

int main(){
char ch;
int cnt = 0;

int flag = 1;
char last;
while((ch = getchar()) != EOF){
if(ch > 'z' || ch < 'a' || is_vowel(ch)) continue;
if(flag == 1){
last = ch;
flag = 0;
}
else{
if(last < ch) cnt++;
last = ch;
}
}
printf("%d\n", cnt);
}


50132. Only Consonants
https://aaronlin1229.github.io/judgegirl_50132/
Author
Akizumi
Posted on
July 17, 2023
Licensed under