1
0
Fork 0

Problem 86

This commit is contained in:
Jonathan Chan 2018-08-25 10:38:06 -07:00
parent df4952ecb4
commit 373792c113
2 changed files with 18 additions and 0 deletions

BIN
86 Normal file

Binary file not shown.

18
86.c Normal file
View File

@ -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);
}