Kojirion

Digits

Problems like those at Project Euler often involve the digits of a number. The solution will usually require something cleverer than iterating over them, however doing so may be the avenue to understanding the problem. It is a shame then that there is no simple way to do so in C++; it is possible to convert the number to a string with std::to_string, but then it is necessary to convert the characters to integers for arithmetic operations, getting in the way of STL algorithms. Clearly(!), it is needed to write an iterator: