'数组元素f(1)到f(9)赋初值为0,代码略
key= Val(Text1. Text)
i=1:j=9
Do While i<=j
m=(i+j)\2
F(m)=1
If a(m)= key then Exit Do 'Exit Do表示退出循环
If a(m)> key Then j= m-1 Else i= m +1
Loop整型数组元素a(1)到a(9)为升序序列,在文本框 Text1中输入待查找数,执行该程序段后,下列选项中,f(1)到f(9)各元素值不可能的是( )。
A.1,1,0,0,1,0,0,0,0 |
B.0,0,0,0,1,0,0,0,0 |
C.0,0,0,0,1,1,1,1,0 |
D.0,1,1,1,1,0,0,0,0 |
同类型试题
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