题库 高中信息

题干

(加试题)某程序的部分代码如下:
Dim a(1 to 8) As Integer
Dim i As Integer ,k As Integer,key As Integer
Key=Val(Tet1.Text)
For i=1 to 8
If a(i)= key Then k=i
Next i
数组元素a(1)到a(8)的数据依次为“6、68、9、25、56、67、25、11”,查找元素key为25,则程序执行后,变量k的值为(    )
A.1B.4C.7D.8
上一题 下一题 0.99难度 选择题 更新时间:2019-05-06 05:21:18

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