http://codeforces.com/contest/49
A
1 #include<bits/stdc++.h> 2 using namespace std; 3 #define lson l,mid,rt<<1 4 #define rson mid+1,r,rt<<1|1 5 #define sqr(x) ((x)*(x)) 6 #define pb push_back 7 #define maxn 1000005 8 typedef long long ll; 9 typedef unsigned long long ull; 10 11 12 int main(){ 13 #ifndef ONLINE_JUDGE 14 freopen("input.txt","r",stdin); 15 #endif 16 std::ios::sync_with_stdio(false); 17 map<char,int>mp; 18 mp['A']++; 19 mp['E']++; 20 mp['I']++; 21 mp['O']++; 22 mp['U']++; 23 mp['Y']++; 24 mp['a']++; 25 mp['e']++; 26 mp['i']++; 27 mp['o']++; 28 mp['u']++; 29 mp['y']++; 30 string str; 31 getline(cin,str); 32 char ch; 33 for(int i=str.length()-1;i>=0;i--){ 34 if((str[i]>='A'&&str[i]<='Z')||(str[i]>='a'&&str[i]<='z')){ 35 ch=str[i]; 36 break; 37 } 38 } 39 if(mp[ch]) cout<<"YES"<<endl; 40 else cout<<"NO"<<endl; 41 }