Imports System.Math
Imports System.Threading
Module Module1
Public Function Ccalc(ByVal a, ByVal b) As Decimal
Return Sqrt(a ^ 2 + b ^ 2)
End Function
Sub Main()
Dim a As Integer = 3
Dim b As Integer = 4
Dim c As Decimal
Dim answer As Long
Dim done As Boolean
For i As Integer = 1 To 500
a += 1
For j As Integer = 1 To 500
b += 1
c = Ccalc(a, b)
If a + b + c = 1000 AndAlso a < b AndAlso b < c AndAlso c / 1 = c \ 1 Then
Console.WriteLine("a = {0}, b = {1}, c = {2}, sum = {3}", a, b, c, a + b + c)
done = True
answer = a * b * c
Exit For
End If
Console.WriteLine("a = {0}, b = {1}, c = {2}, sum = {3}", a, b, c, a + b + c)
Next
b = 4
If done = True Then Exit For
Next
Console.WriteLine(answer)
Console.ReadLine()
End Sub
End Module