-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi.cpp
More file actions
42 lines (31 loc) · 661 Bytes
/
i.cpp
File metadata and controls
42 lines (31 loc) · 661 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
41
42
#include <iostream>
using namespace std;
string vowel = "aeiou";
bool isVolw(char c) {
if(c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U') {
return true;
}
return false;
}
int countVolws(string s, int start, int lastCount)
{
if (start == s.length()-1)
{
if(isVolw(s[start])) {
lastCount++;
}
return lastCount;
}
if (isVolw(s[start]))
{
lastCount++;
}
return countVolws(s, start+1, lastCount);
}
int main()
{
string s;
getline(cin, s);
cout<<countVolws(s, 0, 0);
return 0;
}