Fixed warning comparing signed and unsigned ints

This commit is contained in:
2020-06-09 00:15:25 -04:00
parent cad4f92db3
commit 4262dd5cf5

View File

@@ -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