[单项选择题] 下面程序的运行结果是______。 Dim a,i,s a=Array("6","5","a","b"

23 查阅

[单项选择题] 下面程序的运行结果是______。 Dim a,i,s a=Array("6","5","a","b","2","1") s=0 i=0 Dw While a(i)>="0" And a(i)<="9"s=10* s+a(i)-"0"Print si=i+2 Loop

A.12ba56

B.652

C.6

D.62

参考答案:

C

当i=0时,a(0)=“6”,满足条件执行循环体,使得s=6并输出,i=i+2=2;当i=2时,a(2)=“a”,不满足循环条件,循环结束。因此本程序只输出6。

计算机考试