当前位置: 高中信息技术 / 单选题
  • 1. (2019高二下·温州期中) 有如下VB程序段:

    i = 0: j = 1

    Do While j <= 5

      If a(j) <> 0 Then i = i + 1: a(i) = a(j)

      j = j + 1

    Loop

    For j = i + 1 To 5

      a(j) = 0

    Next j

    数组元素a(1)到a(5)的值依次为“0,20,0,4,31”,执行该程序段后,a(1)~a(6)各元素的值依次为(  )

    A . 4,20,31,0,0 B . 31,20,4,0,0 C . 0,0,20,4,31 D . 20,4,31,0,0

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