Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求助 怎么会 WR了?

Posted by xinxin2005qiuqiu at 2006-11-20 22:45:57 on Problem 3096
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator