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

为什么错了呀?????

Posted by hdjtdxacm at 2008-12-28 21:18:33 on Problem 1936
#include<stdio.h>
#include<string.h>
char s[100010],t[100010];
int main()
{
	int i,j,L,M;
	while(scanf("%s%s",s,t)!=EOF)
	{
		L=strlen(s);
		M=strlen(t);
		if(L>M||((L==M)&&(strcmp(s,t)!=0))) 
		{
			printf("No\n");
			continue;
		}
		j=0;
		int count=0;
		for(i=0;i<L;i++)
		{
			while(s[i]!=t[j])
			{
				j++;
				if(j>=M)
					goto loop;
			}
			count++;
		}
loop:;
		if(count==L)
			printf("Yes\n");
	    else
			printf("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