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

试试aaa aaa为组数据看

Posted by xiangsanzi at 2006-03-29 22:00:09 on Problem 1936
In Reply To:谁能告诉我,错在什么地方???? Posted by:xax10000 at 2006-03-29 20:46:56
> #include<iostream>
> #include<string>
> #include<stdio.h>
> using namespace std;
> char s1[100000], s2[100000];
> int main(int argc, char* argv[])
> {
> 	while(scanf("%s",s1) == 1){
> 		scanf("%s",s2);
> 		long len1 = strlen(s1);
> 		long len2 = strlen(s2);
> 		long i=0, j=0;
> 		for( ;i<len1 && j<len2; ++i){
> 			if(len1 == len2)break;
> 			while(j < len2 && s1[i] != s2[j])j++;
> 		}
> 		if( i == len1 && j < len2)cout<<"Yes\n";
> 		else cout<<"No\n";
> 	}
> 	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