catalyn

in baza b

Sep 24th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,k=0,ogl=0,b;
  8. cin>>n;
  9. cin>>b;
  10. while(n)
  11. {k=k*10+n%b;
  12. n/=b;
  13. }
  14. while(k)
  15. {
  16. ogl=ogl*10+k%10;
  17. k=k/10;
  18. }
  19. cout<<ogl;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment