这个输出是怎么回事,求大神解答
Sample Inputa
tv
ptoui
bontres
zoggax
wiinq
eep
houctuh
end
Sample Output
<a> is acceptable.
<tv> is not acceptable.
<ptoui> is not acceptable.
<bontres> is not acceptable.
<zoggax> is not acceptable.
<wiinq> is not acceptable.
<eep> is acceptable.
<houctuh> is acceptable.
判读条件
1:有元音字母
2:不能三个连续元音或辅音
3.不能连续两个相同的字母,除非ee或oo
#include<stdio.h>
#include<string.h>
int sub(char x)
{
if(x=='a'||x=='e'||x=='i'||x=='o'||x=='u')
return 1;
else
return 0;
}
int main()
{
int len,i,flag=1;
char str[22];
while (scanf("%s",&str)!=EOF)
{
len=strlen(str);
for (i=0;i<len;i++)
{
if (sub(str[i]))
break;
}
if(i==len) flag=0;
for (i=1;i<len;i++)
{
if (str[i]==str[i-1])
{
if(str[i-1]=='o'||str[i-1]=='e') continue;
else { flag=0; break;}
}
}
for (i=2;i<len;i++)
{
if (flag==0) break;
if (sub(str[i])&&sub(str[i-1])&&sub(str[i-2])) flag=0;
if (!sub(str[i])&&!sub(str[i-1])&&!sub(str[i-2])) flag=0;
}
if (flag==0)
printf ("<%s> is not acceptable.\n",str);
else
printf ("<%s> is acceptable.\n",str);
}
}
这是什么情况,求大神指导