forked from rahul22mrk/hackoctoberfest2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCV
32 lines (31 loc) · 676 Bytes
/
CV
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
30
31
32
// https://www.codechef.com/problems/CV
#include <bits/stdc++.h>
using namespace std;
bool isconsonent(char ch){
if(ch!='a' && ch!='e' && ch!='i' && ch!='o' && ch!='u')
return true;
return false;
}
bool isvowel(char ch){
if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
return true;
return false;
}
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string str;
cin>>str;
int count = 0;
for(int i=0;i<n;i++){
if(isconsonent(str[i]) && isvowel(str[i+1])){
count++;
}
}
cout<<count<<endl;
}
return 0;
}