Problem 86
This commit is contained in:
parent
df4952ecb4
commit
373792c113
|
@ -0,0 +1,18 @@
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int M = 100, count = 2060;
|
||||||
|
while(count < 1000000) {
|
||||||
|
M++;
|
||||||
|
for (int i = 1; i <= M; i++) {
|
||||||
|
for (int j = i; j <= M; j++) {
|
||||||
|
double path = sqrt((i + j) * (i + j) + M * M);
|
||||||
|
if (path == floor(path)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("M = %d has %d distinct cuboids\n", M, count);
|
||||||
|
}
|
Loading…
Reference in New Issue