1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
#include <cstdio> #include <vector> #include <cstring> #include <algorithm> #include <iostream> using namespace std; int main() { int t,kase=1; string org,ans,tmp1,tmp2; scanf("%d",&t); getchar(); while(t--) { getline(cin,ans); getline(cin,org); if(org.size()==ans.size()) { bool f=0; for(int i=0;i<org.size();i++) { if(org[i]!=ans[i]) { f=1;break; } } if(f) printf("Case %d: Wrong Answer\n",kase++); else printf("Case %d: Yes\n",kase++); } else { tmp1="";tmp2=""; for(int i=0;i<org.size();i++) { if(org[i]!=' ') tmp1.append(1u,org[i]); } for(int i=0;i<ans.size();i++) { if(ans[i]!=' ') tmp2.append(1u,ans[i]); } if(tmp1.size()!=tmp2.size()) { printf("Case %d: Wrong Answer\n",kase++); } else { bool fl=0; for(int i=0;i<tmp1.size();i++) { if(tmp1[i]!=tmp2[i]) { fl=1;break; } } if(fl) printf("Case %d: Wrong Answer\n",kase++); else printf("Case %d: Output Format Error\n",kase++); } } } return 0; } |