Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cmath>
- using namespace std;
- int main(int argc, const char * argv[]) {
- long long int num,record=0;
- scanf("%lld",&num);
- while(num>0){
- record += pow(10.0,(double)(long long int)log2((double)num));
- num=num-pow(2.0,(double)(long long int)log2((double)num));
- }
- printf("%lld\n",record);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement