UVA492
这个题样例过了,实际WA了
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
bool pd(const char &c)
{
return (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U');
}
int main()
{
string s;
while(cin >> s)
{
bool f = false;
int len = s.length() - 1;
if(s[len] == '.') f = true;
if(pd(s[0]))
{
if(f)
{
for(int i = 0; i <= len - 1; i++)
{
cout << s[i];
}
cout << "ay.";
}
else
{
cout << s << "ay";
}
}
else
{
for(int i = 1; i <= len; i++)
{
cout << s[i];
}
cout << s[0] << "ay";
if(f)
{
cout << ".";
}
}
char b = getchar();
cout << b;
}
return 0;
}