有如下程序段,该程序段执行完后,执行循环的次数是  total=0  Counter=1  Do    Print Counter    total=total + Counter    Print total    Counter=Counter+1  

admin2009-01-15  26

问题 有如下程序段,该程序段执行完后,执行循环的次数是  total=0  Counter=1  Do    Print Counter    total=total + Counter    Print total    Counter=Counter+1    If total>10 Then      Exit Do    End If  Loop While Counter <=10

选项 A、5
B、10
C、15
D、20

答案1

解析 本题考查Do…Loop While语句,共执行了5次,total=1+2+3+4+5>10。
转载请注明原文地址:https://kaotiyun.com/show/yY2p777K
0

最新回复(0)