#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,d;
cin>>a>>b>>d;
int c=a+b;
if(a==0&&b==0){
cout<<0;
return 0;
}
stack<int>st;
while(c!=0){
int cnt=c%d;
st.push(cnt);
c=c/d;
}
while(st.size()!=0){
int k=st.top();
st.pop();
cout<<k;
}
}
1022 D进制的A+B
最新推荐文章于 2024-08-09 20:36:57 发布