fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N;
  6. cin >> N;
  7. vector<int>A(10);
  8. for(int i=0; i<10; i++){
  9. A[i] = N % 2;
  10. N /= 2;
  11. }
  12.  
  13. for(int i=9; i>=0; i--){
  14. cout << A[i];
  15. }
  16. // your code goes here
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5284KB
stdin
37
stdout
0000100101