#include<cstdio>
int main()
{
int a, b, d,sum;
int str[32];
scanf("%d %d %d", &a, &b, &d);
sum = a + b;
int i = 0;
do
{
str[i++] = sum % d;
sum /= d;
} while (sum != 0);
//这里要用do while 之前用while(sum/d!=0||sum%d!=0)放在前面判断 当sum为0就会直接跳出 少了一部分的输出
while (i--)
{
printf("%d", str[i]);
}
return 0;
}
整体难度不大,但是有小细节要注意