From b6a758c284fbeb2e2dd7540d34181c8fae92b3ca Mon Sep 17 00:00:00 2001 From: mjf Date: Tue, 4 Feb 2020 16:28:57 -0500 Subject: a step closer... but not yet --- productofdigits | Bin 16736 -> 16736 bytes productofdigits.c | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/productofdigits b/productofdigits index 2b5d859..814a3c8 100755 Binary files a/productofdigits and b/productofdigits 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; } -- cgit v1.2.3