试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省重点中学2018届高三上学期期末热身联考试卷
max=10 000
For i=1 To 10
s=0
For j=i To 10
s=s+a(j)
If s>max Then max=s
Next j
Next i
已知数组a(1)到a(10)的原始数据为6,-6,8,-7,7,2,-2,-1,-2,4。程序执行后,变量max的值为( )
Private Sub Command1_Click()
Dim x As Integer,y As Integer,z As Integer
x=Val(Text1.Text) ‘第1个正整数
y=Val(Text2.Text) ‘第2个正整数
‘调用函数gcd
Text3.Text=Str(z)
End Sub
Function gcd(a As Integer, b As Integer) As Integer
Do While a <> b
If a>b Then a=a-b Else b=b-a
Loop
gcd=b
End Function
方框中的正确语句是( )
试题篮