| 12 | int is_factorion(int n, int *factorial_array); |
| 13 | |
| 14 | int main(int argc, char **argv) { |
| 15 | |
| 16 | int *factorial_array = array_of_factorials(); |
| 17 | |
| 18 | int result = 0; |
| 19 | |
| 20 | int i = 3; |
| 21 | while(i < (log10(i) + 1) * *(factorial_array + 9)) { |
| 22 | if(is_factorion(i, factorial_array)) result += i; |
| 23 | ++i; |
| 24 | } |
| 25 | |
| 26 | printf("The sum of all factorions in base 10 = %d\n", result); |
| 27 | |
| 28 | free(factorial_array); |
| 29 | factorial_array = NULL; |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | int factorial(int n) { |
| 35 |
nothing calls this directly
no test coverage detected