SRM510 Div2 Easy(250) TheAlmostLuckyNumbersDivTwo
bool lucky( int x ) { int c = 0; for ( ; x>0; x/=10 ) if ( x%10!=4 && x%10!=7 ) c++; return c<=1; } class TheAlmostLuckyNumbersDivTwo{public: int find( int a, int b ) { int ans = 0; for ( int i=a; i<=b; i++ ) if ( lucky(i) ) ans++; return ans; }};