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