问题
单项选择题
有如下的程序片段,该程序片段的执行完后,共执行循环______次。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 <= 10End Sub
答案
参考答案:A
解析: 本题的重点是判断循环非正常退出的问题。该段程序有“total>10”和“Counter<=10”两个条件,只要其中一个条件先成守,循环就退出。total的计算过程为“1+2+3+4=10”,Counter的计算过程为“1+1+1+1=4”。