Write a program that reads expressions by "%d%c%d" pattern (first and third arguments are integers and second is operation) and prints the result of operation. Operations are '+', '-', '*', '/' and '^' (integer power). If operation is unknown, program should print (to stdout, not to stderr) an "Unknown operation" message. If input doesn't correspond the pattern (e. g. "END" is given instead of expression), the program stops. Zero division shall be equal to 0 and negative power shall be equal to 1 (NB: $$-1^-1=1$$ also!)

3+3
100*7
12^3
42/0
100500!500100
2^12
100/3
-1^-1
25-50
.

6
700
1728
0
Unknown operation
4096
33
1
-25


CategoryHomework

HSE/ProgrammingOS/Homework_DummyCalc (последним исправлял пользователь FrBrGeorge 2020-02-26 09:55:52)