当前位置: 高中信息技术 / 单选题
  • 1. (2015·杭州模拟) 某查找算法的部分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

微信扫码预览、分享更方便