1008A Codeforces - Romaji





Solution in c++

#include <bits/stdc++.h>

using namespace std;

bool vow(char x)
{
if(x=='a' || x=='e' || x=='o' || x=='u' || x=='i')
    return true ;
    return false;
}
string inp;
int sz;

int main()
{
    cin>>inp;inp+='x';
    sz=inp.size();

    for(int i=0;i<sz-1;i++)
    {
        if (( vow(inp[i+1])==1) )i++;
        else if (( vow(inp[i])!=1)&& (inp[i]!='n'))
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES";
    return 0;
}

Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق