Updated to allow benchmarking

This commit is contained in:
2020-07-22 13:50:34 -04:00
parent 1370e2bc9a
commit baab41f5c0
35 changed files with 590 additions and 365 deletions

View File

@@ -1,7 +1,7 @@
//ProjectEulerRust/src/Problems/Problems6.rs
//Matthew Ellison
// Created: 06-15-20
//Modified: 06-15-20
//Modified: 07-21-20
//Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/RustClasses
/*
@@ -55,10 +55,10 @@ pub fn solve() -> Answer{
timer.stop();
//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 {}", (sumOfSquares - squareOfSum).abs()), timer.getString(), timer.getNano());
}
/* 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
It took an average of 50.000 nanoseconds to run this problem through 100 iterations
*/