mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-07 01:23:57 -05:00
Changed exception to Unsolved to fit with naming convention
This commit is contained in:
@@ -82,7 +82,7 @@ void Problem12::reset(){
|
||||
std::string Problem12::getString() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
std::stringstream results;
|
||||
results << "The triangular number " << sum << " is a sum of all numbers >= " << counter - 1 << " and has " << divisors.size() << " divisors";
|
||||
@@ -93,7 +93,7 @@ std::string Problem12::getString() const{
|
||||
int64_t Problem12::getTriangularNumber() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ int64_t Problem12::getTriangularNumber() const{
|
||||
int64_t Problem12::getLastNumberAdded() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return counter - 1;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ int64_t Problem12::getLastNumberAdded() const{
|
||||
std::vector<int64_t> Problem12::getDivisorsOfTriangularNumber() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return divisors;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ std::vector<int64_t> Problem12::getDivisorsOfTriangularNumber() const{
|
||||
size_t Problem12::getNumberOfDivisors() const{
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw unsolved();
|
||||
throw Unsolved();
|
||||
}
|
||||
return divisors.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user