/* * ========================================================================= * * FileName: leetcode_788.cpp * * Description: * * Version: 1.0 * Created: 2018-11-28 13:55:44 * Last Modified: 2018-11-28 13:55:59 * Revision: none * Compiler: gcc * * Author: zt () * Organization: * * ========================================================================= */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int rotatedDigits ( int N ) { int ret = 0; string s; size_t pos; for ( int i = 1; i <= N; ++i ) { s = to_string ( i ); pos = s.find_first_not_of ( "0182569" ); if ( pos == string::npos ) { if ( string::npos != s.find_first_of ( "2569" ) ) ++ret; } } return ret; } int main ( int argc, char* argv[] ) { ( void ) argc; ( void ) argv; return 0; }