Skip to content
CalcGospel 國際數學圖譜
返回

IAL 2023 June D1 Q3

A Level / Edexcel / D1

IAL 2023 June Paper · Question 3

题目

Problem

In this question, the function INT(XX) is the largest integer less than or equal to XX. For example, INT(5.7) = 5, INT(8) = 8, INT(−2.3) = −3.

Consider the following algorithm.

Step 1: Input NN

Step 2: Calculate A=N÷10A = N \div 10

Step 3: Let BB = INT(AA)

Step 4: Calculate C=B×10C = B \times 10

Step 5: Calculate D=NCD = N - C

Step 6: Output DD

Step 7: Replace NN by BB

Step 8: If N=0N = 0 then STOP, otherwise go back to Step 2

(a) Complete the table in the answer book, using N=4217N = 4217, to show the results obtained at each step of the algorithm.

(4)

(b) Explain how the output values of the algorithm relate to the original input NN, where NN is any positive integer.

(2)
题目中文翻译

在此问题中,函数 INT(XX) 是小于或等于 XX 的最大整数。例如,INT(5.7) = 5,INT(8) = 8,INT(−2.3) = −3。

考虑以下算法。

第 1 步:输入 NN

第 2 步:计算 A=N÷10A = N \div 10

第 3 步:设 BB = INT(AA)

第 4 步:计算 C=B×10C = B \times 10

第 5 步:计算 D=NCD = N - C

第 6 步:输出 DD

第 7 步:用 BB 替换 NN

第 8 步:如果 N=0N = 0 则停止,否则回到第 2 步

(a) 使用 N=4217N = 4217 完成答案本中的表格,显示算法每一步获得的结果。

(b) 解释算法的输出值与原始输入 NN 之间的关系,其中 NN 是任意正整数。

解答