SHARE
TWEET

Untitled

a guest Mar 26th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int B;
  8.     cin>>B;
  9.    
  10.    
  11.     while (B%2!=1)
  12.         B/=2;
  13.        
  14.     for(int j=0; B>=1; j++)
  15.     {
  16.         if (B%2!=0)
  17.             cout<<"1";
  18.         else
  19.             cout<<"0";
  20.         B/=2;
  21.     }
  22.    
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top