mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Changed exception to Unsolved to fit with naming convention
This commit is contained in:
@@ -72,7 +72,7 @@ void Problem6::reset(){
|
||||
std::string Problem6::getString() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
std::stringstream results;
|
||||
results << "The difference between the sum of the squares and the square of the sum of all numbers from 1-100 is " << abs(sumOfSquares - squareOfSum);
|
||||
@@ -83,7 +83,7 @@ std::string Problem6::getString() const{
|
||||
uint64_t Problem6::getSumOfSquares() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return sumOfSquares;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ uint64_t Problem6::getSumOfSquares() const{
|
||||
uint64_t Problem6::getSquareOfSum() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return squareOfSum;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ uint64_t Problem6::getSquareOfSum() const{
|
||||
uint64_t Problem6::getDifference() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return abs(sumOfSquares - squareOfSum);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user