试题 试卷
题型:单选题 题类:常考题 难易度:普通
江苏省连云港市2020-2021学年高一上学期信息技术期末调研试卷
i=0
sum=0
while i<10:
if i%3==0:
sum+=i
i+=1
print("sum=",sum)
Dim a(1 To 5) As Integer
a(1) = 1
For i = 2 To 5
a(i) = Int(Rnd * 5) + 1
If a(i) Mod 2 = 0 Then
a(i) = a(i) + i
Else
a(i) = a(i) + a(i - 1)
End If
Next i
a(1)~a(5)的值不可能的是( )
a=2
b=5
If a<b Then
m=a
m=b
该程序段运行后,变量m的值为( )。
n=int(input("请输入n值:"))
x=n;y=0
if x>0:
y=y+1
elif x<0:
y=y-1
print (y)
执行上述语句,下列说法不正确的是( )
tmps = [32,28,26,29]
n = len (tmps) ; top = -1
an s = [0] * n
stk = [-1] * n
for i in range(n):
t = tmps[i]
while top > -1 and t > tmps[stk[top]] :
d = stk[top]
top -= 1
an s[d] = i - d
top += 1
stk[top] = i
print(an s)
执行该程序段后,输出的结果是( )
s=[2,3,8,7,5]
for i in range(len(s)-1):
for j in range(len(s)-1,i,-1):
if s[j]<s[j-1]:
执行该程序段,加框处语句被执行的次数是( )
试题篮