当前位置: 高中信息技术 / 单选题
  • 1. (2020高三下·金华月考) 有如下VB程序段:

    c = 0 :i = 1

    Do While i <=6

      k = i

      For j = i + 1 To 7

        If a(j)<= a(k) Then k = j

      Next j

      If a(i) <> a(k) Then

       t = a(i): a(i) = a(k): a(k) = t

       c = c + 1

      End If

      i = i + 1

    Loop

    数组元素a(1)到a(7)的值依次为“9,9,8,16,45,9,78”。该程序段执行后,变量c的值是(  )

    A . 0 B . 3 C . 4 D . 6

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