题型:填空题 题类:常考题 难易度:困难
浙江省温州市十校联合体2017届高三上学期期末考试技术试题(信息技术部分)
Private Sub Command1_Click()
Dim i As Integer, j As Integer, sum As Integer
Dim n As Integer
n = Val(Text1.Text)
sum = 0
List1.Clear
For i = 1 To n ' ①
j = i - 1
Do While sum <= n ' ②
j = j + 1
sum = sum + j
Loop
If sum = n Then
List1.AddItem Str(i) & " + ... +" & Str(j) & "=" & Str(n)
End If
sum = 0
Next i
End Sub
① ②
试题篮