Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
688 B
4
Indexable
Never
#include <stdio.h>

long p5(long n) {
    long m = n * n;
    return m * m * n;
}

int main (int argc, char **argv) {
    for (long e = 1; e < 1000; e++) {
        printf("e = %lu\n", e);
        for (long a = 1; a < e; a++) {
            for (long b = a; b < e; b++) {
                for (long c = b; c < e; c++) {
                    for (long d = c; d < e; d++) {
                        if (p5(a) + p5(b) + p5(c) + p5(d) == p5(e)) {
                            printf("a = %lu, b = %lu, c = %lu, d = %lu, e = %lu\n", a, b, c, d, e);
                            return 0;
                        }
                    }
                }
            }
        }
    }
    return 0;
}