题目内容
如图是输出某个数列前10项的框图,则该数列第3项的值是 .
【答案】分析:分析程序中各变量、各语句的作用,再根据流程图所示的顺序,可知:该程序的作用是利用循环计算并输出变量A的值,模拟程序的运行,用表格对程序运行过程中各变量的值进行分析,不难得到输出结果.
解答:解:程序在运行过程中各变量的值如下表示:
是否继续循环 输出A A N
循环前//1 1
第一圈 是 1
2
第二圈 是
3
…
则该数列第3项的值是
故答案为:
.
点评:求一个程序的运行结果我们常用模拟运行的方法,但在模拟过程中要注意对变量值的管理、计算及循环条件的判断.如果变量较多,或程序循环次数较多时,我们可以用表格管理各变量的值.
解答:解:程序在运行过程中各变量的值如下表示:
是否继续循环 输出A A N
循环前//1 1
第一圈 是 1

第二圈 是


…
则该数列第3项的值是

故答案为:

点评:求一个程序的运行结果我们常用模拟运行的方法,但在模拟过程中要注意对变量值的管理、计算及循环条件的判断.如果变量较多,或程序循环次数较多时,我们可以用表格管理各变量的值.

练习册系列答案
相关题目