+ 2
Using Euclid's formula: http://code.sololearn.com/c9TT4MM7L4ic public class Program { public static void main(String[] args) { int count = 0; for (int m = 2; count < 15; m++) { for (int n = 1; (count < 15)&&(n < m); n++) { int a = m*m - n*n; int b = 2*m*n; int c = m*m + n*n; System.out.println("(" + a + ", " + b + ", " + c + ")"); count++; } } } }
14th Sep 2016, 8:24 PM
Zen
Zen - avatar