From f80d51119b7a1c38a3c87a9f605eb96a10b3c80a Mon Sep 17 00:00:00 2001 From: Coin de Gamma Date: Wed, 1 Mar 2023 16:23:06 +0000 Subject: [PATCH] 006 ok (previous was not ok, sorry i lied) --- 006/solution.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/006/solution.rs b/006/solution.rs index 448472c..4091305 100644 --- a/006/solution.rs +++ b/006/solution.rs @@ -3,7 +3,7 @@ fn main() { // SOLUTION 1 let mut sum_1 = 0; let mut sum_a = 0; - for i in 0..100 { + for i in 0..=100 { sum_1 += i; sum_a += i * i; } @@ -15,7 +15,7 @@ fn main() { { // SOLUTION 2 - let n = 99; + let n = 100; let solution_2 = ( (n * (n + 1) ) / 2) * ( (n * (n + 1) ) / 2 ) - ( (n * (n + 1) * (2 * n + 1)) / 6 ); println!("solution2: {}", solution_2); }