试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省宁波市镇海中学2021届高三上学期信息技术选考适应性测试卷
s = 0: x ="0123456789": i = 1
Do While i <= Len(x)
t = Val(Mid(x,i,2))
If t Mod 3 = 0 Then s = s + t
i = i + 1
Loop
执行该段程序后,s的值为( )
Private Sub Command1_Click()
Dim y As Integer
y = Val(Text1.Text)
Label1.Caption = Str(f(y))
End Sub
Function f(n As Integer) As Integer
If (n = 1) Or (n = 2) Then
f = 1
Else
f = f(n - 1) + f(n - 2)
End If
End Function
程序运行时,在文本框中输入8,单击命令按钮Command1后,Label1中显示的内容是:
Dim a(1 to 5) as integer, i as integer, c as integer
a(1)=2: a(2)=1: a(3)=3: a(4)=4: a(5)=5
c=0
for i=3 to 5
if a(i-2)+a(i-1) =a(i) then c=c+1
next i
text1.text = str(c)
该程序运行后,文本框text1中显示的内容是( )
Dim a(1 To 7) As Integer
a(1) = 14: a(2) = 15: a(3) = 0: a(4) = 11: a(5) = 13: a(6) = 21: a(7) = 17
i = 6: flag = True
Do While i > 1 And flag
If a(i) Mod 3 = 0 And a(i) <> 0 Then
t = a(i): a(i) = a(i + 1): a(i + 1) = t
ElseIf a(i) = 0 Then
flag = flase
ElseIf a(i + 1) Mod 2 = 1 Then
a(i) = Abs(a(i) - a(i + 1))
i = i - 1
import pandas as pd
s1=pd.Series(range(1,12,3))
print(s1)
该程序段运行后输出结果为( )
试题篮