试题 试卷
题型:单选题 题类:常考题 难易度:普通
【gb】浙江省绍兴市海亮高级中学2020-2021学年高一下学期信息技术期中考试试卷
a=[4,5,3, 6, 7,8,2, 9, 1]
m,c=1,1
for i in range(1, len(a)):
if a[i]>=a[i-1]:
c+=1
m=max (m, c)
else:
c=1
print(c,m)
则程序执行后,c和m的值分别是( )
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 )
执行该程序段后,输出结果为( )
试题篮