VB程序如下:
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim k As Integer
For i = 1 To 20
For j = i + 1 To 20
For k = j + 1 To 20
If ggs(i, j, k) = True Then
Print i, j, k
End If
Next k
Next j
Next i
End Sub
Public Function ggs(a As Integer, b As Integer, c As Integer) As Boolean
If a * a + b * b = c * c Then ggs = True
End Function