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 70 |
#include <iostream> #include <cstdio> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <cmath> #include <cstdlib> using namespace std; string s,ans; string str,str1; int n,m; bool accept() { if(n!=m) return 0; if(str==str1) return 1; return 0; } bool presentation() { string num1="",num2=""; for(int i=0;i<str.size();i++) { if(isdigit(str[i])) num1.append(1u,str[i]); } for(int i=0;i<str1.size();i++) { if(isdigit(str1[i])) num2.append(1u,str1[i]); } if(num1==num2) return 1; return 0; } int main() { int kase=1; char c; while(scanf("%d",&n),n) { getchar(); str="";str1=""; for(int i=0;i<n;i++) { getline(cin,s); str.append(s); } scanf("%d",&m); getchar(); for(int i=0;i<m;i++) { getline(cin,ans); str1.append(ans); } if(accept()) printf ("Run #%d: Accepted\n", kase++); else if(presentation()) printf ("Run #%d: Presentation Error\n",kase++); else printf ("Run #%d: Wrong Answer\n",kase++); } return 0; } |