Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- vector<long long int>v;
- long long int n;
- cin>>n;
- while(n!=0){
- long long int r=n%2;
- n=n/2;
- v.push_back(r);
- }
- reverse(v.begin(),v.end());
- for(int i=0;i<v.size();i++)
- cout<<v[i]<<" ";
- cout<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement