Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string uppercaseConsonants(string str, string newstr, int i = 0)
- {
- if(isupper(str[i]))
- {
- if(isupper(str[i]) != 'A' || isupper(str[i]) != 'E' ||
- isupper(str[i]) != 'I' || isupper(str[i]) != 'O' ||
- isupper(str[i]) != 'U' && !isspace(str[i]))
- {
- newstr += str[i];
- }
- }
- if(i < str.length()-1)
- {
- return uppercaseConsonants(str, newstr, i + 1);
- }
- return newstr;
- }
- int main()
- {
- string str, newstr = "";
- while(getline(cin, str))
- {
- cout << uppercaseConsonants(str, newstr) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement