diff options
author | mjf <mjf@localhost.localdomain> | 2020-02-04 16:28:57 -0500 |
---|---|---|
committer | mjf <mjf@localhost.localdomain> | 2020-02-04 16:28:57 -0500 |
commit | b6a758c284fbeb2e2dd7540d34181c8fae92b3ca (patch) | |
tree | ca95de9f1ce84abe8387e39cb986256001015946 | |
parent | cd692dd6425eeb2c2e96565de36ed571ea00f8ff (diff) | |
download | Project_Euler_Solutions-b6a758c284fbeb2e2dd7540d34181c8fae92b3ca.tar.gz |
a step closer... but not yet
-rwxr-xr-x | productofdigits | bin | 16736 -> 16736 bytes | |||
-rw-r--r-- | productofdigits.c | 4 |
2 files changed, 2 insertions, 2 deletions
diff --git a/productofdigits b/productofdigits Binary files differindex 2b5d859..814a3c8 100755 --- a/productofdigits +++ b/productofdigits diff --git a/productofdigits.c b/productofdigits.c index fc7606d..e00b801 100644 --- a/productofdigits.c +++ b/productofdigits.c @@ -28,9 +28,9 @@ int parseNum(const char *x, int r){ printf("%s\n", x); for(int i = 0; i < len - r; i++){ // Digits in ascii start at 48 - int prod = (int) (x[i] - 48); + long long int prod = (long long int) (x[i] - 48); for(int k = i + 1; k < i + r; k++) - prod *= (int) (x[k] - 48); + prod *= (long long int) (x[k] - 48); if(prod > max) max = prod; } |