def fun(n):
a, b=0,1
while a < n:
print(a, end=' ')
a, b=b, a+b
fun(5)



C .
D .
Private Sub Command1_Click()
Dim x As String,xq As String,num As Integer
Dim i As Integer,h As Integer,f As Boolean
x=”一二三四五六日”
xq=Text1.Text
num= ①
f=False:i=1
Do While i<=7 And f=False
If xq=Mid(x,i,1)Then
h=i:f=True
End If
i=i+1
Loop
r=(h+num) Mod 7
If r=0 Then
Label1.Caption=“星期日”
Else
Label1.Caption=“星期”+ ②
End If
End Sub
① ②
s=0:k=0
For i=1 to 7 step 2
If i<=1 then
k=k+1
Elseif i<=2 then
k=k+2
Elseif i<=3 then
k=k+3
End if
s=s+k
Next i
该程序段运行后,s值是( )
For i=1 To 2
For j=5 To i+1 Step-1
If a(j)<a(j-1) Then
t=a(j) : a(j)=a(j-1) : a(j- 1)=t
End If
Next j
Next i
数组元素a(1)到a(5)的值依次为“95,88,66,80,75”,经过该程序段“加工”后,数组元素a(1)到a(5)的值依次为( )
Dim a(1 to 6) as Integer
s = 0
Do While s <= 5
t = Int(Rnd * 6 +1)
a(t) = a(t) + 1
If a(t) = 1 Then s = s + a(t)
Loop
已知数组a(1)到a(6)的初值均为0,运行该程序段后,a(1)到a(6)不可能是( )