题目:http://acm.hdu.edu.cn/showproblem.php?pid=1039
#include<bits/stdc++.h>
#define PI 3.1415926
#define INF 1e18
using namespace std ;
typedef long long ll;
typedef unsigned long long ull;
char t[5]={'a','o','e','u','i'};
int main(){
string s;
while(cin>>s){
if (s=="end") break;
bool k = false;
for(int i = 0 ; i < s.length() ; i++){//有无元音
for(int j = 0 ; j < 5 ; j++)
if(s[i] == t[j]){
k = true;
break;
}
if(k) break;
}
if(!k){
cout<<"<"<<s<<">"<<" is not acceptable."<<endl;
continue;
}
int yc=0,fc=0;
bool nc = false;
for(int i = 0 ; i < s.length() ; i++){//连续三个元音或者辅音
for(int j = 0 ; j < 5 ; j++)
if(s[i] == t[j]){
nc = true;
break;
}
if(nc){
yc++;
fc=0;
nc=false;
if(yc == 3){
k = false;
break;
}
}
else{
yc=0;
fc++;
if(fc == 3){
k = false;
break;
}
}
}
if(!k){
cout<<"<"<<s<<">"<<" is not acceptable."<<endl;
continue;
}
for(int i = 0 ; i < s.length()-1 ; i++){
if(s[i]=='o') continue;
else if(s[i]=='e') continue;
else if(s[i]==s[i+1]){
k = false;
break;
}
}
if(!k){
cout<<"<"<<s<<">"<<" is not acceptable."<<endl;
continue;
}
else
cout<<"<"<<s<<">"<<" is acceptable."<<endl;
}
return 0;
}