Uva_489
2015-05-16 17:44 HaodongGUO 阅读(101) 评论(0) 编辑 收藏 举报#include<stdio.h> #include<string.h> char a[1000],b[1000]; int main() { int n,t,i,j; while(scanf("%d",&n)!=-1&&n!=-1) { t=0; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); scanf("%s%s",a,b); for(i=0,j=0;b[i]!='\0';i++) { /*if(a[i]=='\0') { //break; }*/ if(a[j]==b[i]) { //t++; // printf("%c ",b[j]); j++; //printf("%c ",b[j]); } else { t++; } } if(t<=6&&a[j]=='\0') { printf("round %d\nYou win.\n",n); } if(t>=7) { printf("round %d\nYou lose.\n",n); } if(t<=6&&a[j]!='\0') { printf("round %d\nYou chickened out.\n",n); } } return 0; }
以上代码并没有ac测试,仅供参考!!