题干

某查找算法的部分VB代码如下:

shifouzhaodao = False    ‘shifouzhaodao:是否找到

szysxh = 0 ‘szysxh:数组元素序号

Do While szysxh < 5 And not shifouzhaodao

   szysxh = szysxh + 1

   if dczsz(szysxh) = Key then shifouzhaodao = true

Loop

if not shifouzhaodao then szysxh = 0

数组元素dczsz (1)到dczsz (5)的数据依次为“-1,3,7,10,7”,当变量key值为7时,运用该算法处理后,变量i的值是(   )

A:0

B:-1

C:3

D:5

上一题 下一题 0.0难度 选择题 更新时间:2019-08-28 01:44:22

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

C