You are on page 1of 2

#include <iostream>

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
//type definitions
typedef long long LL;
typedef double DB;
//macros
#define REP(i,n) for (int i = 0; i < (n); ++i)
#define REPD(i,n) for (int i = (n)-1; 0 <= i; --i)
#define FOR(i,a,b) for (int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for (int i = (a); (b) <= i; --i)
#define SET(a, b) memset(a, b, sizeof a)
#define STOP() system("pause")
#define IN() freopen("a.txt", "r", stdin); freopen("b.txt", "w", stdout)
#define SC(a) scanf("%d", &a)
bool cekvow(string a)
{
int j, n;
string vow="aiueo";
n=a.length();
for(j=0;j<5;j++)
if(a[0]==vow[j] || a[0]==toupper(vow[j]))
return true;
return false;
}
bool cekcons(string a)
{
int j;
string cons="bcdfghjklmnpqrstvwxyz";
int n=a.length();
int n2=cons.length();
for(j=0;j<n2;j++)
if(a[0]==cons[j] || a[0]==toupper(cons[j]))
return true;
return false;
}
int main()
{
string s, ss;
while(getline(cin, s))
{
int len=s.length(), i=0;
while(i<len)
{
ss.clear();
while(i<len && isalpha(s[i]))
{
ss+=s[i];
i++;
}
if(cekvow(ss))
{
cout<<ss<<"ay";
}
else if(cekcons(ss))
{
int lens=ss.length();
FOR(i, 1, lens-1)
cout<<ss[i];
cout<<ss[0]<<"ay";
}
while(i<len && !isalpha(s[i]))
cout<<s[i++];
}
cout<<endl;
}
}

You might also like