题目内容
【题目】执行如下图的程序框图,如果输入的,则输出的( )
A. B. C. D.
【答案】C
【解析】试题分析:执行第1次,t=0.01,S=1,n=0,m==0.5,S=S-m=0.5, =0.25,n=1,S=0.5>t=0.01,是,循环,
执行第2次,S="S-m" =0.25, =0.125,n=2,S=0.25>t=0.01,是,循环,
执行第3次,S="S-m" =0.125, =0.0625,n=3,S=0.125>t=0.01,是,循环,
执行第4次,S=S-m=0.0625, =0.03125,n=4,S=0.0625>t=0.01,是,循环,
执行第5次,S="S-m" =0.03125, =0.015625,n=5,S=0.03125>t=0.01,是,循环,
执行第6次,S=S-m=0.015625, =0.0078125,n=6,S=0.015625>t=0.01,是,循环,
执行第7次,S=S-m=0.0078125, =0.00390625,n=7,S=0.0078125>t=0.01,否,输出n=7,故选C.
练习册系列答案
相关题目