
- #include
- 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<
- }
- }