aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjf <mjf@localhost.localdomain>2020-02-04 16:28:57 -0500
committermjf <mjf@localhost.localdomain>2020-02-04 16:28:57 -0500
commitb6a758c284fbeb2e2dd7540d34181c8fae92b3ca (patch)
treeca95de9f1ce84abe8387e39cb986256001015946
parentcd692dd6425eeb2c2e96565de36ed571ea00f8ff (diff)
downloadProject_Euler_Solutions-b6a758c284fbeb2e2dd7540d34181c8fae92b3ca.tar.gz
a step closer... but not yet
-rwxr-xr-xproductofdigitsbin16736 -> 16736 bytes
-rw-r--r--productofdigits.c4
2 files changed, 2 insertions, 2 deletions
diff --git a/productofdigits b/productofdigits
index 2b5d859..814a3c8 100755
--- a/productofdigits
+++ b/productofdigits
Binary files differ
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;
}