mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Fixed warning comparing signed and unsigned ints
This commit is contained in:
@@ -40,7 +40,7 @@ std::vector<uint64_t> Problem30::getDigits(uint64_t num){
|
||||
//The easiest way to get the individual digits of a number is by converting it to a string
|
||||
std::string digits = std::to_string(num); //Holds a string representation of num
|
||||
//Start with the first digit, convert it to an integer, store it in the vector, and move to the next digit
|
||||
for(int cnt = 0;cnt < digits.size();++cnt){
|
||||
for(unsigned int cnt = 0;cnt < digits.size();++cnt){
|
||||
listOfDigits.push_back(std::stoi(digits.substr(cnt, 1)));
|
||||
}
|
||||
//Return the list of digits
|
||||
|
||||
Reference in New Issue
Block a user