Dim he() As Integer
Private Sub Command2_Click()
Dim x As Integer, y As Integer
For x = -99 To 99
For y = -49 To 49
If (3 * x) - (8 * y) = 100 Then
ReDim Preserve he(i)
he(i) = x + y
i = i + 1
End If
Next
Next
Call bijiao
End Sub
Sub bijiao()
Dim max As Integer, i As Integer
max = 0
For i = 0 To UBound(he)
Print he(i)
If max < he(i) Then
max = he(i)
End If
Next
Print "和最大为:"; Str(max)
End Sub