代码实现
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
char get(int n)
{
if (n < 10) return n + '0';
return n - 10 + 'a';
}
string base(int n, int b)
{
string num;
while (n) num += get(n % b), n /= b;
reverse(num.begin(), num.end());
return num;
}
int main()
{
LL A, B, b;
cin >> A >> B >> b;
A += B;
if (A) cout << base(A, b) << endl;
else cout << 0 << endl;
return 0;
}