CCL's Calculator

TimeLimit:1000MS  MemoryLimit:256MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

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’而处理麻烦

Input

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.


Output

For each test case, the first line outputs the complete expression and result, and the second line outputs the total length of the expression


SampleInput
4
add 44 45
323 328
sub 556 34
mul 854 31
SampleOutput
44+45=89
8
323+328=651
11
556-34=522
10
854*31=26474
12
Submit
题目统计信息详细
总AC数35
通过人数32
尝试人数32
总提交量145
AC率22.07%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
作者

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: