szhhck have an old calculator bought 5 years ago.he find the old machine can just calculate expressions like this :
A-B、A+B、A*B、A/B、A%B.
because it is too old and long time not use,the old machine maybe conclude a wrong answer sometime.
Your task is to write a program to check the answer the old calculator calculates is correct or not.
输入 First input is a single line,it's N and stands for there are N test cases.then there are N lines for N cases,each line contain an equation like A op B = C(A,B and C are all integers,and op can only be + , - , * , / or % ). More details in the Sample Input. 输出 For each test case,if the equation is illegal(divided or mod by zero),you should Output "Input Error".and if the equation is correct,Output "Accept";if not Output "Wrong Answer",and print the right answer after a blank line. 样例输入 5 1+2=32 2-3=-1 4*5=20 6/0=122 8%9=0 样例输出 Wrong Answer 3 Accept Accept Input Error Wrong Answer 8 #include <stdio.h> int main() { int number; scanf("%d",&number); while(number--!=0){ int num1,num2,result; char fh; scanf("%d%c%d=%d",&num1,&fh,&num2,&result); switch(fh){ case '+': if(num1+num2==result){ printf("Accept\n"); }else{ printf("Wrong Answer\n%d\n",num1+num2); } break; case '-': if(num1-num2==result){ printf("Accept\n"); }else{ printf("Wrong Answer\n%d\n",num1-num2); } break; case '*': if(num1*num2==result){ printf("Accept\n"); }else{ printf("Wrong Answer\n%d\n",num1*num2); } break; case '/': if(num2==0){ printf("Input Error\n"); }else if(num1/num2==result){ printf("Accept\n"); }else{ printf("Wrong Answer\n%d\n",num1/num2); } break; case '%': if(num2==0){ printf("Input Error\n"); }else if(num1%num2==result){ printf("Accept\n"); }else{ printf("Wrong Answer\n%d\n",num1%num2); } break; } } return 0; }