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 |
这样为什么不可以?#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void) { int n=0,i=0,j=0,p=0,k=0,icount=0,count=0,o=1,a,b,c; char s[1005],t[1005],q[1005]; scanf("%d",&n); while(n--) { scanf("%s %s %s",s,t,q); a=strlen(s); b=strlen(t); c=strlen(q); while(j<a&&k<c) { if(s[j]==q[k]) { icount++; k++; j++; } else { k++; } } while(i<b&&p<c) { if(t[i]==q[p]) { count++; p++; i++; } else { p++; } } if(icount==a&&count==b) { printf("Date set %d: yes\n",o); } else { printf("Date set %d: no\n",o); } o++; i=0; j=0; k=0; p=0; icount=0; count=0; } system("PAUSE"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator