| ||||||||||
| 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 | |||||||||
求助 怎么会 WR了?#include<iostream>
#include<string>
#define MAX 1000
using namespace std;
void main()
{
int surp[MAX],i,j,k,l;
string p[MAX];
for(i=0;;i++)
{
cin>>p[i];
surp[i]=1;
if(p[i][0]=='*')
break;
for(j=0;j<p[i].length();j++)
for(k=j+1;k<p[i].length();k++)
{
if(p[i][k]==p[i][j])
for(l=1;k+l<p[i].length();l++)
if(p[i][k+l]==p[i][j+l])
{
surp[i]=0;
goto loop;
}
}
loop:;
}
for(j=0;j<i;j++)
{
cout<<p[j];
if(surp[j])
cout<<" is surprising."<<endl;
else
cout<<" is NOT surprsing."<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator