| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
请教高手。。。W在哪。。。#include<iostream>
using namespace std;
int dif(char a[1000])
{
if(a[0]=='e'&&a[1]=='n'&&a[2]=='d'&&a[3]=='\0')
return 0;
}
int main()
{
char a[1000];
while(gets(a)&&dif(a))
{
int i,x(0),j(0),k(0);
int m[5000],n[5000];
m[0]=1,n[0]=1;
for(i=0,x;i<=strlen(a);i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
{x++;
m[i+1]=m[i]+1;
n[i+1]=n[i];
}
else
{
m[i+1]=m[i];
n[i+1]=n[i]+1;
}
if(a[i]==a[i+1]&&a[i]!='e'&&a[i]!='o')
j++;
if(m[i]-m[i-3]==3||n[i]-n[i-3]==3)
k++;
}
if(x!=0&&j==0&&k==0)
cout<<"<"<<a<<"> is acceptable."<<endl;
else
cout<<"<"<<a<<"> is not acceptable."<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator