#include <iostream> #include <stdio.h> #include <math.h> using namespace std ; int main( int argc, const char * argv[]) {     long long int n;     while ( scanf ( "%lld" ,&n)!= EOF ){     int i,j;     for (i = 1 ; i <= 10000 ; i ++) {                  n -= powl ( 2 , i);         if (n<= 0 ) {             n+= powl ( 2 , i);             break ;         }     }     for (j = i- 1 ; j >= 0 ; j --) {         if ( powl ( 2 , j) >= n) {             printf ( "4" );         }         else {             printf ( "7" );             n -= powl ( 2 , j);         }     }         printf ( "\n" );     }     return 0 ; }
点赞 评论

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务