A-A+
有如下的程序片段 该程序片段的执行完后 共执行循环______次。 Private Sub
问题详情
有如下的程序片段,该程序片段的执行完后,共执行循环______次。 Private Sub command1_ Click() total =0 Counter = 1 do Print Counter total = total + Counter Print total, "111" Counter = Counter + 1 if total >= 10 then exit do End if Loop while Counter <= 10 End Sub
请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:A
本题的重点是判断循环非正常退出的问题。该段程序有“total>10”和“Counter<=10”两个条件,只要其中一个条件先成守,循环就退出。total的计算过程为“1+2+3+4=10”,Counter的计算过程为“1+1+1+1=4”。