Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- //dGhpcyBwcm9ncmFtIGlzIGxlYXJuaW5nIHNhbXBsZSwgZG9uJ3QgdXNlIGl0IGZvciB5b3VyIGhvbWV3b3Jr
- using namespace std;
- int main()
- {
- int in;
- while(cin>>in)
- {
- string ans;
- while(in>0)
- {
- if(in%2!=0)
- {
- ans='1'+ans;
- }
- else
- {
- ans='0'+ans;
- }
- in/=2;
- }
- cout<<ans<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement