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