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

为什么我的程序WA呀,运行了很多情况结果都满足题目呀,难道还有漏掉的?????????????

Posted by _pink at 2007-08-20 10:27:21 on Problem 1936
#include<iostream.h>
#include<string.h>
int main(){
	char s[100000],t[100000];
	int l;char a;
	while(cin>>s>>t){
		l=strlen(s);
		int l1=strlen(t);
		int num=0;int i;
		if(l1<l) goto No;
		for( i=0;i<l1-l+1;i++){	
			
			a=t[i+l];
			t[i+l]='\0';
			if(s[0]!=t[i]){t[i+l]=a;continue;}
            if(strcmp(s,t+i)==0){cout<<"Yes"<<endl;num=1;break;}
            if(num==0)t[i+l]=a; 
		}
No:	if(num==0) cout<<"No"<<endl;
	}
return 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