60分求助
查看原帖
60分求助
1374286
Cyanic_mouse楼主2024/11/24 21:11
#include <bits/stdc++.h>
using namespace std;
string dic="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main() {
	int n,bit,t=0;
	bool started=false;
	cin >> n >>bit;
	for(int i=((int)pow(n,1.0/(double)bit))+1;n!=0;i--) {
		while(n>=pow(bit,i)) {
			n-=pow(bit,i);
			t++;
		}
		if(t>0)started=true;
		if(started)cout << dic[t];
		t=0;
	}
	return 0;
}
2024/11/24 21:11
加载中...