试题 试卷
题型:单选题 题类: 难易度:普通
浙江省苍南中学2023-2024学年高一下学期信息技术期中考试试卷
n = int(input())
a,b,num = 2,1,2
for i in range(n-1):
print(num)
方框中的代码由以下三部分组成:①num += a / b ②a = a + b ③b = a - b代码顺序正确的选项是( )
Dim a(1 To 100)As Integer
n=Val(Text1.Text)
a(1)=0:a(3)=1
s=1
Next i
Text2.Text=Str(s)
方框中的代码由以下三部分组成:
①a(i)=a(i-2)+a(i-4) ②s=s+a(i)
③For i=5 To n Step 2
代码顺序正确的选项是( )
s=0
For k = 3 To 1 Step -1
If k <= 1 Then x = 1
If k <= 2 Then x = 2
If k <= 3 Then x = 3
s = s + x
Next k
该程序段运行后,变量 s 的值是( )
Private Sub Command1_Click()
Dim Pi As Single, t As Single
Dim n As Integer, s As Integer
Pi = 0
t = 1: n = 1: s =1
Do While Abs(t) >= 0.0001
Pi = Pi + t
n ={#blank#}1{#/blank#}
s= {#blank#}2{#/blank#}
t = s / n
Loop
Text2.Text ={#blank#}3{#/blank#}
End Sub
⒈能被4整除,但不能被100整除;
⒉能被400整除;
que=[""]*20
head,tail= 0,0
for i in range(3):
que[tail]=chr(97+i)
tail+= 1
st=["b","c","d","a"]
top=3
while head < tail and top > - 1:
if st[top]==que[head]:
head+= 1
else:
que[tail] = st[top]
top-= 1
print(que[head:tail])
执行该程序段,则输出的结果是( )
a = [ 5 , 4 , 2 , 1 , 3 , 6 ] ; q = [ 0 ] * 6 ; head = tail = 0
for i in range( len( a ) ):
if a[ i ] % 2 == 1 :
q[ tail ] = a[ i ] ; tail = tail + 1
elif head < tail :
head += 1
print( tail – head )
执行该程序段后,输出结果为( )
试题篮