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