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> 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator