>>127

・Java

public static List<Integer[]> pyths (int n) {
    List<Integer[]> list = new ArrayList<Integer[]>();
    for (int x = 1; x <= n; x++) {
        for (int y = 1; y <= n; y++) {
            for (int z = 1; z <= n; z++) {
                if (x * x + y * y == z * z) {
                    Integer[] a = {x, y, z};
                    list.add(a);
                }
            }
        }
    }
    return list;
}