fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. int N=0, t=0, d=1;
  7. cin>>N;
  8. if (N>0){
  9. vector <int> v = {};
  10. while(N)
  11. {
  12. t +=(N%2)*d;
  13. N=N/2;
  14. d=d*10;
  15.  
  16. }
  17. v.push_back(t);
  18. for (auto x:v){
  19. cout << x;
  20. }
  21. }else{
  22. //cout << "Число должно быть больше 0";
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 15224KB
stdin
132
stdout
10000100