#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
string to_radix(const long long &n,long long d)
{
string ret;
long long result = n / d;
long long reminder = n%d;
while (result > 0)
{
ret += to_string(reminder);
reminder = result%d;
result = result / d;
}
ret += to_string(reminder);
string out_ret(ret.rbegin(),ret.rend());
return out_ret;
}
int main()
{
long long a, b,d;
cin >> a >> b >> d;
string result_of_radix = to_radix((a+b),d);
cout << result_of_radix;
cout << endl;
system("pause");
return 0;
}
网友评论