Nathan Coulas

CCC '02 J2 - AmeriCanadian

ccc02j2 CPP17 10 Apr, 2020 0.012s 3 points

Source Code

#include <iostream>
using namespace std;

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	string inp;
	int l;
	cin >> inp;
	while(inp != "quit!"){
			l = inp.length();
			if(l > 4 && inp[l - 1] == 'r' && inp[l - 2] == 'o' && !(inp[l - 3] == 'a' || inp[l - 3] == 'e' || inp[l - 3] == 'i' || inp[l - 3] == 'o' || inp[l - 3] == 'u' || inp[l - 3] == 'y')){
				
				cout << inp.substr(0, l - 2) << "our\n";
			}else{
				cout << inp << "\n";
			}
			
		cin >> inp;
	}
		
	return 0;
	}