fork download
  1. #include<iostream>
  2. #include<iomanip>
  3. #include<math.h>
  4. #include<string>
  5. #include<algorithm>
  6. using namespace std;
  7. int main()
  8. {
  9. long long n;
  10. int arr[100],i,r;
  11. cin>>n;
  12.  
  13. while(n!=0)
  14. {
  15. r=n%2;
  16. arr[i++]=r;
  17. n=n/2;
  18. }
  19. for(int j=i-1;j>=0;j--)
  20. {
  21. cout<<arr[j];
  22. }
  23. if(n==0)
  24. cout<<"0";
  25. return 0;
  26. }
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
111111111111110010010011110010100101101011110000