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