题型:综合题 题类:常考题 难易度:普通
浙江省杭州市西湖高级中学2018-2019学年高二下学期信息技术4月月考试卷
Const n = 20
Dim a(1 To n) As Integer
Private Sub Command1_Click()
Dim i As Integer
Randomize
For i = 1 To n
a(i) = Int(Rnd * 1000) + 1
List1.AddItem Str(a(i))
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, max As Integer
Dim min As Integer, sum As Single
max = a(1): min = a(1)
sum = 0
For i = 2 To n
If Then max = a(i)
If a(i) < min Then min = a(i)
sum = sum + a(i)
Next i
Text1.Text = Str(max)
Text2.Text = Str(min)
Text3.Text = Str(sum)
End Sub
五行程序代码中有{#blank#}1{#/blank#}处错误,在对应的横线上修改
第二行 if x%2 = 0 第三行 print(x, "为偶数") 第四行 else: 第五行 print("x, 为奇数") |
改成: {#blank#}2{#/blank#} {#blank#}3{#/blank#} {#blank#}4{#/blank#} {#blank#}5{#/blank#} {#blank#}6{#/blank#} |
试题篮