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 !!(code) 高手指教啊

Posted by chris2007_1984 at 2004-10-24 22:42:29 on Problem 1936
#include "stdio.h"
#include "string.h"

char s[10000],t[10000];
int ls,lt;

int main()
{
	int i,j;
	memset(s,0,sizeof(s));
	memset(t,0,sizeof(t));
	while(EOF!=scanf("%s",s))
	{
		scanf ("%s",t);
		ls = strlen(s);
		lt = strlen(t);
		if(lt ==0)break;
		j=-1;
		for(i=0;i<ls;i++)
		{
			while(1)
			{
				j++;
				if (j == lt&&i!=ls-1)
				{
					printf("No\n");
					goto NEXT;
				}
				if (s[i] == t[j])
				{
					if (i == ls-1)
					{
						printf("Yes\n");
						goto NEXT;
					}
					break;
				}				
			}
		}
NEXT:;	
		memset(s,0,sizeof(s));
		memset(t,0,sizeof(t));
	}
	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