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<iostream> #include<stdio.h> using namespace std; int main() { char s[100001],t[100001]; int sl,tl,i,j; while(1) { memset(s,0,sizeof(s)); memset(s,0,sizeof(t)); if(scanf("%s%s",s,t)==EOF) break; sl=strlen(s); tl=strlen(t); if(sl>tl) { printf("No\n"); continue; } j=0; for(i=0;i<sl&&j<tl;i++) { while(j<tl&&s[i]!=t[j])j++; j++; } if(i>=sl) 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