Problem 2717 --Computation - Simple Calculator

2717: Computation - Simple Calculator

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $573$ 正确数量 $290$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL

Simple Calculator 

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. 

a op b 

The input ends with a single '?'. Your program should not process for this terminal symbol.

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.

推荐代码 查看2717 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 波士顿大龙虾 811255 2022-02-26 15:41:39
内存最少[$0 $KB] 土豆人 509313 2019-10-27 22:50:39
第一AC 刘成健 315100 2018-11-16 21:56:07
第一挑战 刘成健 315100 2018-11-16 21:56:07

赛题来源/所属竞赛 会津大学《C++ Programming I》 C++程序设计(入门)

竞赛编号 竞赛名称 竞赛时间 访问比赛
1660 2021-2022-1学期《C语言程序设计》:循环结构I【21计算机】 2021-10-25 00:00:00 请登录
1564 2020-2021-1学期《C语言程序设计》:循环结构I【20计算机12345】 2020-10-23 10:00:00 请登录
1391 2019-2020-1学期《C语言程序设计I》:循环结构I【19计算机12班】 2019-10-23 10:00:00 请登录