Solution – 49A – Sleuth – codeforces

April 3, 2016 § Leave a comment

//c++
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    getline(cin,s);
    bool res=false;
    int x=s.length()-1;
    while(res!=true)
    {
        res=isalpha(s[x]);
        if(res==true &&(s[x]=='A' ||s[x]=='a' || s[x]=='e' || s[x]=='E' || s[x]=='I' ||s[x]=='i' ||s[x]=='o' || s[x]=='O' || s[x]=='U' ||s[x]=='u' ||s[x]=='Y' || s[x]=='y'))
         {cout<<"YES"<<endl; return 0;}
        else if(res==true)
            {cout<<"NO"<<endl; return 0;}
        else
            x--;
    }

}

Find more from my submissions HERE

Advertisements

Tagged: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Solution – 49A – Sleuth – codeforces at Orange Notes.

meta

%d bloggers like this: