diff --git a/39 b/39 new file mode 100755 index 0000000..2cfb230 Binary files /dev/null and b/39 differ diff --git a/39.c b/39.c new file mode 100644 index 0000000..cf20ee9 --- /dev/null +++ b/39.c @@ -0,0 +1,22 @@ +#include +#include + +int main () { + int maxP = 12; + int maxSols = 1; + for (int p = 12; p <= 1000; p++) { + int sols = 0; + for (int c = 1; c <= p - 2; c++) { + for (int a = 1; a <= (p - c - 1) / 2; a++) { + int b = p - c - a; + if (a * a + b * b == c * c) + sols++; + } + } + if (sols > maxSols) { + maxSols = sols; + maxP = p; + } + } + printf ("%d\n", maxP); +}