Dim d(1 to 5)as integer,i as integer
Dim flag as Boolean,j as integer
‘给数组元素d(1)至d(5)赋初值为1,代码略
Randomize
For i=1 to 5
J = l:flag = Trued(i) = int(Rnd*9)
Do while j< =i-1 and flag = True
d(i) = int(Rnd*5+1)
If d(i) = d(j) then i=i-l:flag = False
j = j+1
Loop
Next i
运行程序后,数组中的数据值可能是( )A.1 3 4 5 6 | B.3 5 4 1 1 | C.8 3 1 2 5 | D.1 2 6 2 1 |

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

