시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1422 950 881 70.991%

문제

덧셈, 뺄셈, 곱셈, 나눗셈을 할 수 있는 계산기 프로그램을 만드시오.

입력

입력의 각 줄에는 숫자와 +, -, *, /, =중 하나가 교대로 주어진다. 첫 번째 줄은 수이다. 연산자의 우선 순위는 생각하지 않으며, 입력 순서대로 계산을 하고, =가 주어지면, 그때까지의 결과를 출력한다. 주어지는 수는 108 이하의 양의 정수이다. 계산 중 결과는 0 또는 음수가 될 수 있지만, -108 ~ 108 범위를 넘지는 않는다. 또, 나눗셈에서 소수점은 버린다. 따라서, 100/3*3 = 99이다.

피제수가 음수일 때 나눗셈을 하는 경우는 입력으로 주어지지 않는다.

출력

첫째 줄에 계산 결과를 출력한다.

예제 입력 1

1
+
1
=

예제 출력 1

2
W3sicHJvYmxlbV9pZCI6IjU2MTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjYzRcdWMwYjBcdWFlMzAgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWIzNjdcdWMxNDgsIFx1YmU4NFx1YzE0OCwgXHVhY2YxXHVjMTQ4LCBcdWIwOThcdWIyMTdcdWMxNDhcdWM3NDQgXHVkNTYwIFx1YzIxOCBcdWM3ODhcdWIyOTQgXHVhY2M0XHVjMGIwXHVhZTMwIFx1ZDUwNFx1Yjg1Y1x1YWRmOFx1YjdhOFx1Yzc0NCBcdWI5Y2NcdWI0ZGNcdWMyZGNcdWM2MjQuPFwvcD5cclxuIiwiaW5wdXQiOiI8cD5cdWM3ODVcdWI4MjVcdWM3NTggXHVhYzAxIFx1YzkwNFx1YzVkMFx1YjI5NCBcdWMyMmJcdWM3OTBcdWM2NDAgKywgLSwgKiwgXC8sID1cdWM5MTEgXHVkNTU4XHViMDk4XHVhYzAwIFx1YWQ1MFx1YjMwMFx1Yjg1YyBcdWM4ZmNcdWM1YjRcdWM5YzRcdWIy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