#include #include "boost/lexical_cast.hpp" using namespace std; using namespace boost; int main() { // Here goes nothing! string pool; // Here be sum! long sum = 0; // Here be digit pool swimming extravaganza! for(int i = 0; i <= 100000; i++) { pool = lexical_cast(i); // Here be dragons! for(string::iterator it=pool.begin(); it < pool.end(); it++) { if (lexical_cast(*it) != 3 || lexical_cast(*it) != 5 || lexical_cast(*it) != 7) { // cout << lexical_cast(*it) << endl; // Debugging sum += lexical_cast(*it); } } } // Here be hope! cout << sum << endl; }