| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
谁能告诉我哪里错了?为什么一直WA????#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator