Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- long long trece( long long x10)
- {
- long long cifra, p10=1, xb=0;
- while(x10)
- {
- cifra=x10%2;
- xb=xb+cifra*p10;
- p10=p10*10;
- x10=x10/2;
- }
- return xb;
- }
- int main()
- {
- long long x, y;
- cin>>x;
- y=trece(x);
- cout<<y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement