美文网首页PAT
PAT1022打卡-0924

PAT1022打卡-0924

作者: 可爱的甜甜猪 | 来源:发表于2020-09-24 14:47 被阅读0次

```c++#include <iostream>

#include <cmath>

using namespace std;

int main()

{

long long int A,B;

long long int C;

int D;

cin>>A>>B;

C=A+B;

cin>>D;

int n=0;

while(C>=D)

{

C=C/D;

n++;

}

//cout<<n+1<<endl;

C=A+B;

int cou;

while(n>=0)

{

cou=C/pow(D,n);

C=C-cou*pow(D,n);

n--;

cout<<cou;

}

return 0;

}

相关文章

网友评论

    本文标题:PAT1022打卡-0924

    本文链接:https://www.haomeiwen.com/subject/cmiayktx.html