Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n=0;
- int p=0;
- int m=0;
- int main()
- {
- cin>>n;
- m=n;
- for(int i=0;i<m;i++)
- {
- p=n%2;
- if(p!=0)
- {
- p=1;
- }
- else
- p=0;
- if(n>0)
- {
- cout<<n<<" | "<<p<<endl;
- }
- else
- {
- cout<<n<<" | "<<"-"<<endl;
- }
- n/=2;
- if(p==0 && n==0)
- {
- goto miejsce_skoku;
- }
- }
- miejsce_skoku:
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement