Dim i As Integer
Dim j As Integer
Dim a As Single
Dim b As Single
Private Sub Command1_Click()
For i = 0 To 100
For j = i To 100
a = Sqr(i + j)
b = Sqr(j - i)
If a = Int(a) And b = Int(b) Then
Print i, j
End If
Next j
Next i
End Sub
Private Sub Form_Load()
Dim i, j, n
For i = 1 To 100
For j = 1 To 100
n = i + j
If fc(n) Then
n = i - j
If n > 0 Then If fc(n) Then List1.AddItem i & "-" & j & "=" & i - j & Space(5) & i & "+" & j & "=" & i + j
End If
Next
Next
End Sub
Function fc(n) As Boolean
If (Int(Sqr(n))) ^ 2 = n Then fc = True
End Function