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 08063102 at 2011-07-21 15:55:07 on Problem 3302
#include<stdio.h>
#include<string.h>
char t[110],s[110];
int main()
{
char *ps,*pt;
int n,i,j,k;
 scanf("%d",&n);
while(scanf("%s %s",s,t)!=EOF&&n)
{
  i=strlen(s)-1;  
 ps=s;
 pt=t;
 j=0;k=0;
   n--;
   while(*ps)
   {
   	  j=2*k;         
	if(*ps==*pt||*(ps+i-j)==*pt)
      {
      	pt++;
      } 
   if('\0'==*pt) 
       {
           printf("YES\n");
            break;
        }
      ps++;
      k++;
      
    }
   if(*pt) 
   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