题解 | #又一版 A+B#
又一版 A+B
https://www.nowcoder.com/practice/9255c05d45b8406c9b588d7c57aa920b
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long a, b, c;
int m;
while (cin >> m && m != 0) {
cin >> a >> b;
c = a + b;
string res = "";
do {
res += c % m + '0';
c = c / m;
} while (c != 0);
reverse(res.begin(), res.end());
cout << res << endl;
}
return 0;
}
查看8道真题和解析