Added times to existing problems

This commit is contained in:
2020-06-15 14:44:14 -04:00
parent 6966097445
commit 73aef0ee84
6 changed files with 22 additions and 4 deletions

View File

@@ -51,5 +51,6 @@ pub fn solve() -> Answer{
} }
/* Results: /* Results:
The sum of all numbers < 1000 is 233168
It took 1.000 microseconds to solve this problem
*/ */

View File

@@ -49,5 +49,6 @@ pub fn solve() -> Answer{
} }
/* Results: /* Results:
The sum of all even fibonacci numbers <= 3999999 is 4613732
It took 5.100 microseconds to solve this problem
*/ */

View File

@@ -51,5 +51,6 @@ pub fn solve() -> Answer{
} }
/* Results: /* Results:
The largest factor of the number 600851475143 is 6857
It took 1.254 seconds to solve this problem
*/ */

View File

@@ -67,3 +67,8 @@ pub fn solve() -> Answer{
//Return the results //Return the results
return Answer::new(format!("The largest palindrome is {}", palindromes[palindromes.len() - 1]), timer.getString()); return Answer::new(format!("The largest palindrome is {}", palindromes[palindromes.len() - 1]), timer.getString());
} }
/* Results:
The largest palindrome is 906609
It took 109.264 milliseconds to solve this problem
*/

View File

@@ -61,3 +61,8 @@ pub fn solve() -> Answer{
//Save the results //Save the results
return Answer::new(format!("The smallest positive number evenly divisibly by all number 1-20 is {}", currentNum), timer.getString()); return Answer::new(format!("The smallest positive number evenly divisibly by all number 1-20 is {}", currentNum), timer.getString());
} }
/* Results:
The smallest positive number evenly divisibly by all number 1-20 is 232792560
It took 2.524 seconds to solve this problem
*/

View File

@@ -57,3 +57,8 @@ pub fn solve() -> Answer{
//Save the results //Save the results
return Answer::new(format!("The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is {}\n", (sumOfSquares - squareOfSum).abs()), timer.getString()); return Answer::new(format!("The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is {}\n", (sumOfSquares - squareOfSum).abs()), timer.getString());
} }
/* Results:
The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is 24174150
It took 0.000 nanoseconds to solve this problem
*/