-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path44.cpp
More file actions
40 lines (39 loc) · 620 Bytes
/
44.cpp
File metadata and controls
40 lines (39 loc) · 620 Bytes
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
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
using namespace std;
int checkVowel(string s,int loc,int i)
{
char v[]={'a','e','i','o','u','A','E','I','O','U'};
int count= 0;
for (int j = i;j<loc;j++)
{
for (int p = 0;p<10;p++)
{
if(v[p]==s[j])
count++;
}
}
return count;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin.tie(NULL);
int t;
cin>>t;
int count =0;
while(t--)
{
string a;
cin>>a;
for(int i=0;i<a.length();i++)
{
int j = a.length();
while(j--)
{
count = checkVowel(a,j,i)+ count;
}
}
cout<<count<<"\n";
}
}