Time limit1sMemory limit1024 MB
Given integers A, B, and C, print A+B-C once with them as numbers and once with them as JavaScript strings.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
In JavaScript, the operators and work as ordinary addition and subtraction on numbers. On strings, concatenates the two strings, and converts both strings to numbers and then subtracts.
Given , , and as numbers or as strings, compute .
Input
The first line contains an integer .
The second line contains an integer .
The third line contains an integer .
Every given number is a positive integer without a leading zero.
Output
On the first line, print when , , and are treated as numbers.
On the second line, print when , , and are treated as strings.
Hint
For both numbers and strings, evaluates first and then .