浙江大学机试 又一版 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);
	}
}

  

posted @ 2020-03-11 01:36  暮云林凌  阅读(166)  评论(0)    收藏  举报