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 q307518235 at 2011-02-10 21:26:29 on Problem 3302
#include<stdio.h>
#include<string.h>
int main()
{ 
	int l,l1,j,m,n;
	char a[2000],b[2000];
	while(scanf("%d",&n)==1)
	{
		while(n--)
		{
		scanf("%s%s",b,a);

		l=strlen(a);
		l1=strlen(b);
		if(l>l1)
			printf("NO\n");
	else
	{
		m=0;
		    j=0;
	    	for(;j<l1;j++)
		    	if(a[m]==b[j])
				{   
					m++;
				
				
			  
				}
			if(l==m)
				printf("YES\n");
			else
			{
             m=0;
		    j=0;
	    	for(j=l1;j>0;j--)
		    	if(a[m]==b[j])
				{   
					m++;
				
				
			  
				}
		if(l==m)
				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