赞 | 0 |
VIP | 40 |
好人卡 | 2 |
积分 | 1 |
经验 | 10932 |
最后登录 | 2016-5-17 |
在线时间 | 462 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 462 小时
- 注册时间
- 2007-7-30
- 帖子
- 643
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 忧雪の伤 于 2011-7-31 12:46 编辑
One day, Ruby picked up a calculator on the ground. But she isn't sure whether it is broken or not. She wants to test the calculator, but she doesn't want to calculate by herself. So, can you help her to calculate the right answer?
Ruby will give you the question to test the calculator. And you must to receive her the correct answer. (The question only have numbers and `+' `-' `*' `/' these four operations)
First you will get a number N.And next N lines will be the question.
The question must be a normal math expression like "1+2+46/5", you only have to remenber the rule of math.
There must have zero or more whitespaces between the operations and numbers.
(There's no float number, only integer)
For each questions, you must output a new line and the answer to the question.
Standard I/O,
if/else statement,
Some simple operations.
某天 Ruby 在地上捡到了一个计算器。但是她不确定这台计算器是好是坏,所以想来测试它。但是 Ruby 又不想自己动手算数字,所以你能帮助他一下吗?
Ruby 会给你几个用来测试计算器的算式,然后你必须要给她正确的答案。(算式里只会出现数字与四则运算符)
首先会有一个数字 n ,紧接着N行都是一个算式。值得注意的是,运算符与数字之间可能会有 0 个或以上的空格。(只会有整数运算不会出现小数点。)
對於每個算式輸出一行結果。
标准输出入;
if,else 判断;
一些简单的运算符。
line display |
|