#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]!=' ';i++) { /*if(a[i]==' ') { //break; }*/ if(a[j]==b[i]) { //t++; // printf("%c ",b[j]); j++; //printf("%c ",b[j]); } else { t++; } } if(t<=6&&a[j]==' ') { printf("round %d You win. ",n); } if(t>=7) { printf("round %d You lose. ",n); } if(t<=6&&a[j]!=' ') { printf("round %d You chickened out. ",n); } } return 0; }
以上代码并没有ac测试,仅供参考!!