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 <stdlib.h> #include <string.h> int main() { int n,k = 0,i,j,flag,len1,len2,len3; char s1[201],s2[201],s3[201]; scanf("%d",&n); while(n--) { k++; flag =0; scanf("%s%s%s",s1,s2,s3); len1 = strlen(s1); len2 = strlen(s2); len3 = strlen(s3); for(j = 0,i = 0; j < len3 && i < len1;) { if(s1[i] == s3[j]) { i++;j++; } else j++; } if(i == len1) flag = 1; else printf("Data set %d: no\n",k); if(flag == 1) { for(i = 0,j=0; i < len2 && j < len3;) { if(s2[i] == s3[j]) { i++;j++; } else j++; } if(i == len2) printf("Data set %d: yes\n",k); else printf("Data set %d: no\n",k); } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator