试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省金华市江南中学2020届高三信息技术3月14日网课第五周测试卷
For i= 1 To 2
For j=5 To i+1 Step-1
If a(j) >a(i) Then
t=a(j):a(j)=a(i):a(i)=t
End If
Next j
Next i
数组元素a(1)到a(5)的值依次为“33,24,45,16,77”,经过该程序段“加工”后,数组元素a(1)到a(5)的值依次为( )
For i = 1 To 2
For j = 5 To i + 1 Step -1
If a(j) > a(i) Then
t = a(j): a(j) = a(i): a(i) = t
数组元素a(1)到a(5)的值依次为“33,24,,4,16,77”,经过该程序段“加工”后,数组元素a(1)到a(5)的值依次为( )
'待排序数据存储在数组a中(a(1)~a(n)),要求升序排列
For i=1To(n-1)\2
For j=1To n-i*2
If a Then '①
t= a(j):a(j)= a(j+ 2):a(j+2)= t
For i = 1 To n\2
j = 2 * i - 1
If a(j)> a(j+ 1)Then t = a(j):a(j)= a(j+1):a(j+1)= t
For i= Step 2 '②
t = a(i):j = i - 1
Do While t <a(j)
a(j+ 1)= a(j):j =j-1
Loop
a(j+ 1)= t
①{#blank#}1{#/blank#}②{#blank#}2{#/blank#}
inp=input("请输入a、b: ") #1
a=float(inp.split( )[0])
b=float(inp.sp1it( )[1]) #2
if a>b: #3
print(a)
else #4
print(b)
试题篮