Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int n, to;
- cin >> n >> to;
- string s;
- while (n > 0) {
- s = "0123456789ABCDEF"[n % to] + s;
- n /= to;
- }
- cout << s << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement