题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC代码
#include<bits/stdc++.h>
#include<cmath>
#define mem(a,b) memset(a,b,sizeof a);
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main()
{
int A,B,D,rnt;
cin>>A>>B>>D;
rnt=A+B;
if(rnt==0)
{
cout<<0;
return 0;
}
int s[1000];
int i=0;
while(rnt!=0)
{
s[i++]=rnt%D;
rnt/=D;
}
for(int j=i-1;j>=0;j--)
cout<<s[j];
return 0;
}