Problem 9

Ruby

 1m = 2
 2break_nested = false;
 3loop do
 4    if m > 1000
 5        break
 6    end
 7    n = 1
 8    loop do
 9        if n > m
10            break
11        end
12        a = ((m ** 2) - (n ** 2))
13        b = (2*m * n)
14        c = (m ** 2 + n ** 2)
15        if a + b + c == 1000
16            puts"#{a*b*c}"
17            break_nested = true;
18            break
19        end
20        n +=1
21    end
22    break if break_nested;
23    m += 1
24end