将一组数据(共n*n个数),分别存放在a(1)…a(n*n)中,通过下面程序实现n段有序(升序),例如:当n=4时,排序结果如图所示:
有如下VB程序段:
For i = 1 To n
For j = n * (i - 1) + 1 To ①
For k = ② To ③
If a(k) > a(k + 1) Then
t =a(k): a(k) = a(k + 1): a(k + 1) = t
End If
Next k
Next j
Next i
上述程序段划线处的表达式正确的是( )
- A、① n * i – 1 ② n * (i - 1) + 1 ③ n * (2 * i - 1) – j
- B、① n * (i - 1) ② n * i – 1 ③ n * i - j
- C、① n * i – 1 ② n * i + j ③ n * (2 * i - 1)
- D、① n * i ② n * (i - 1) + 1 ③ n * i - j