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 |
和你的也差不多呀,为什么过不了?In Reply To:真的很郁闷!!!这两个程序有差别吗? Posted by:xtu716 at 2007-08-08 19:59:21 #include <stdio.h> #include <string.h> int main () { char a[10000]={'\0'},b[10000]={'\0'}; int c,d; int i,j; while (EOF!=scanf ("%s%s",a,b)) { c=strlen(a); d=strlen(b); if (c>=d) { i=0;j=0; while (a[i]!='\0') { if (a[i]==b[j]) { i++;j++; } else i++; } if (j==d) printf ("Yes\n"); else printf ("No\n"); } if (c<d) { i=0;j=0; while (b[i]!='\0') { if (b[i]==a[j]) { i++;j++; } else i++; } if (j==c) 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