1
0
Fork 0
Project-Euler/C/25-test.c
2012-04-05 05:32:56 -04:00

15 lines
No EOL
327 B
C
Executable file

#include <stdio.h>
#include <math.h>
#define DIGITS 100000
int main(void) {
long double goldenRatio = (1 + sqrt(5)) / 2;
int number1 = (int)ceil((DIGITS - 1 * log10(5)) / log10(goldenRatio));
int number2 = (int)ceil((DIGITS - 1 + log10(5) / 2) / log10(goldenRatio));
printf("%d = %d\n", number1, number2);
return 1;
}