Bebras高年级阶段样题示例(17-18岁)

折纸

(年龄组:高年级;难度:中等;类别:代数、信息)

The Beaver has developed a programming language for paper folding. This language can be used to explain how to fold any piece of paper with straight sides. One of the commands in this language is fold. e = fold(a, b) means:

海狸开发了一种用于折纸的编程语言。这种语言可用于解释如何折叠任何具有直边的纸张。该语言中的一个指令是“折叠”。e = fold(a, b) 表示:

fold the piece of paper in a way that side a is lying completely on side b.

将这张纸折叠,使 A 边完全叠在 B 边上。

In that way you create a new side, the fold. This line is called e. Example:

这样你就创造了一个新的边,即折痕。这条线被称为 e。例如:

Bebras高年级阶段样题示例(17-18岁)

Please note, that the paper remains on the table during folding, and that the length of side b is twice the length of side a. How does the paper rectangle (a, b, c, d) look like after the execution of these three commands?

请注意,纸张在折叠过程中始终放在桌面上,且边 b 的长度是边 a 长度的两倍。执行这三条指令后,纸张矩形(a,b,c,d)会是什么样子?

e = 折叠(c, a)  ;   f = 折叠(c, d)  ;   g = 折叠(a, f)

答案解析:

The correct answer is A. The following images explain the execution of the fold-operation step by step.

正确答案是 A。以下图片逐步解释了折叠操作的执行过程。

说明:

Functions are an important concept in programming. A function call is considered to be the start of some activity. Programmers say: The function accepts some parameters (here: two sides), processes some data and returns an object (here: the fold). This is different from the concept of functions in mathematics.

函数是编程中的一个重要概念。函数调用被视为某种活动的开始。程序员们说:函数接受一些参数(这里:两边),处理一些数据并返回一个对象(这里:折痕)。这与数学中的函数概念不同。

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

欢迎咨询【Bebras辅导课程】

在线客服
微信咨询