#C12907. Mini Calculator
Mini Calculator
Mini Calculator
This problem requires you to implement a mini calculator that performs basic arithmetic operations. The calculator should accept two integers, a and b, and a string representing an arithmetic operation, and then output the result of the operation. The allowed operations are:
- Addition (add)
- Subtraction (subtract)
- Multiplication (multiply)
- Division (divide)
If a division by zero is attempted, your program should output "Division by zero is not allowed". For any operation other than the four specified, output "Invalid operation". When performing division, if \(b \neq 0\) then compute \(a \div b\). If the result is an integer value, you should output it as an integer.
inputFormat
The input consists of a single line containing two integers and a string, separated by spaces:
\(a\) \(b\) operation
For example: 4 2 add
outputFormat
Output the result of the arithmetic operation. For division, if b is zero, output "Division by zero is not allowed". For invalid operations, output "Invalid operation".
## sample4 2 add
6
</p>