http://poj.org/problem?id=1013
1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 const int INF=1<<28; 5 int main() 6 { 7 char rw[3][21],lw[3][21],vis[3][11]; 8 int ans[303],t; 9 scanf("%d",&t); 10 while(t--) 11 { 12 memset(ans,0,sizeof(ans)); 13 for (int i = 0; i < 3; i ++) 14 { 15 scanf("%s %s %s",lw[i],rw[i],vis[i]); 16 } 17 for (int i = 0; i < 3; i ++) 18 { 19 if(vis[i][0]=='e') 20 { 21 for (int j = 0; lw[i][j]!='