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 nof12345 at 2010-04-22 21:25:36 on Problem 1458
#include<stdio.h>
#include<string.h>
int main()
{
    char a[500],b[500];
	int thiss,count,i,j,la,lb,judge;
	while(scanf("%s%s",a,b)!=EOF)
	{
	la=strlen(a);
	lb=strlen(b);
	thiss=0;
	count=0;
	for(i=0;i<la;i++)
	{
		judge=0;
		j=thiss;
		while(j<lb&&judge==0)
		{
		if(a[i]==b[j])
		{
			j++;
			thiss=j;
			judge=1;
			count++;
		}
		else
			j++;
		}
	}
	printf("%d\n",count);

	}
	return 0;
}



结果是wrong answer

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