2015年Bebras挑战练习题-Throw the dice(掷骰子)

After school the young beavers are used to play together.

放学后,这些小海狸们习惯一起玩耍。

To avoid quarrels about where to play, they throw a normal six sided die.

为了避免争论在哪里玩,他们掷一个普通的六面骰子。

The decision is found according to this rule:

该决定是依照此规则作出的:

2015年Bebras挑战练习题-Throw the dice(掷骰子)

Question: 问题:

Which sequence of throws will send the young beavers to the sports field?

哪一种投掷顺序能让小海狸们去到运动场?

A.   

B.

C.

D.

 

 

 

 

 

Explanation 解释

The correct answer is 3/3/3.

正确答案是 3/3/3。

The first throw (3) is not greater than the second throw (3), so we have to follow the ELSE-IF branch. The third throw (3) is not greater than the first throw (3), so the rule sends the young beavers to the sports field. Throw sequence 6/6/2 sends them to the river. Throw sequence 5/3/1 sends them to the woods. Throw sequence 2/4/1 sends them to the river, too.

第一次投掷(3)不大于第二次投掷(3),所以我们得遵循 ELSE-IF 分支。第三次投掷(3)不大于第一次投掷(3),所以规则将幼海狸们送到了运动场。投掷序列 6/6/2 将它们送到了河里。投掷序列 5/3/1 将它们送到了树林。投掷序列 2/4/1 也将它们送到了河里。

Bebras新赛季备赛已开启,扫码领取Bebras真题资料⇓

欢迎咨询【Bebras专业辅导课程】

(Bebras每日一练部分展示)

在线客服
微信咨询