浙江大学机试 又一版 A+B Easy
基本思想:
无;
关键点:
无;
#include<iostream>
#include<string>
using namespace std;
typedef long long ll;
void charge(ll r, ll n) {
if (n == 0) {
cout << 0 << endl;
return;
}
string res = "";
while (n != 0) {
res = char(n%r + '0') + res;
n /= r;
}
cout << res << endl;
return;
}
int main() {
ll n,m,k;
while (cin >> k) {
if (k == 0)
break;
cin >> m >> n;
charge(k, m + n);
}
}

浙公网安备 33010602011771号