题库 高中信息

题干

有VB程序段如下:
s="2019.06 Visual Basic6.0":n=0
For i=1 To Len(s)
ch=Mid(s,i,1)
If ch>="0" And ch<="9"Then
m=Asc(ch)-Asc("0")+1
a(m)=a(m)+1
End If
Next i
For i=1 To 10
If a(i)>1Then n=n+i
Next i
数组a各元素的初始值都为0,执行该程序段后,则变量n的值为(    )
A.2B.4C.8D.10
上一题 下一题 0.99难度 选择题 更新时间:2019-11-20 12:46:57

答案(点此获取答案解析)