#P1957. Simple Arithmetic Formatter
Simple Arithmetic Formatter
Simple Arithmetic Formatter
Teacher Wang is teaching simple arithmetic and has collected several problems that students often get wrong. He wants to compile these problems into a practice exercise. To reduce the amount of input work, the arithmetic problem 5+8
should be generated by simply providing the numbers 5
and 8
.
Your task is to read two non-negative integers a and b, form an expression in the format \(a+b=c\) (where \(c=a+b\)), and then output the complete expression followed by the total number of characters in that expression. For example, given input 5 8
, the first line of the output should be 5+8=13
and the second line should be 6
(since there are 6 characters in "5+8=13").
inputFormat
The input consists of two non-negative integers a
and b
separated by a space.
outputFormat
The output should contain two lines:
- The first line displays the arithmetic expression in the format \(a+b=c\) (with no extra spaces), where \(c\) is the sum of \(a\) and \(b\).
- The second line displays the total number of characters in the expression.
sample
5 8
5+8=13
6
</p>