1024: Simple Calculator

内存限制:128 MB 时间限制:1.000 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1967 通过:757

题目描述

Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.

The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

输入格式

The input consists of multiple datasets. Each dataset is given in the following format.

aopb

The input ends with a dataset where op = '?'. Your program should not process for this dataset.

输出格式

For each dataset, print the value in a line.

输入样例 复制

1 + 2
56 - 18
13 * 2
100 / 10
27 + 81
0 ? 0

输出样例 复制

3
38
26
10
108

数据范围与提示

  • 0 ≤ a, b ≤ 20000
  • No divisions by zero are given.