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

Re:第一题。。留念

Posted by ztzt at 2013-09-15 21:17:09 on Problem 3096
In Reply To:第一题。。留念 Posted by:never_no at 2010-10-16 23:37:43
> #include<iostream>
> #include<string>
> using namespace std;
> int main()
> {
> 	int i,j,t;
> 	char a[100];
> 	char b[100][2];
> 	while(cin>>a)
> 	{
> 		if(a[0]=='*') break;
> 		t=0;
> 		for(int k=1;k<=strlen(a)-1;k++)
> 		{
> 		for(i=0;i<strlen(a)-k;i++)
> 		{
> 			b[i][0]=a[i];
> 			b[i][1]=a[i+k];
> 			for(j=0;j<i;j++)
> 			{
> 				if(b[i][0]==b[j][0]&&b[i][1]==b[j][1])
> 				{
> 					t=1;
> 					break;
> 				}
> 			}
> 			if(t==1) break;
> 		}
> 		if(t==1) break;
> 		}
> 		if(t==1)
> 		{
> 			cout<<a<<" is NOT surprising."<<endl;
> 		}
> 		else
> 		{
> 			cout<<a<<" is surprising."<<endl;
> 		}
> 	}
> }

为什么j初始不是等于1,而是0

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