Everyday CCL have to do lots of arithmetical problems, such as "44+33=77","55-22=33","33*2=66", but he is so tired of doing the same thing again and again, so he asks you for help. As a smart ACMer, can you write a program to help him?
此题最好不要使用gets读入,gets 会因为读到‘/r’而处理麻烦
The first line contains a single integer T(T<=10000), the number of the test cases.
The next T line is the formula that needs to be calculated, and each line may have three data or two data.
If the line has three data, the first data represents the operation type, "add" represents the addition operation, "sub" represents the subtraction operation, "mul" represents the multiplication operation, and the next two data represent the operands participating in the operation.
If the line has two data, it means that the operation type of this question is the same as the operation type of the previous question, and the two data are operands
The input guarantees that both operands and results do not exceed the range of int.
For each test case, the first line outputs the complete expression and result, and the second line outputs the total length of the expression
4 add 44 45 323 328 sub 556 34 mul 854 31
44+45=89 8 323+328=651 11 556-34=522 10 854*31=26474 12