文章
13
粉丝
76
获赞
5
访问
7.9k
#include <bits/stdc++.h>
using namespace std;
string division(string s, const int &from, const int &to, int &remain){
remain = 0;
for(int i = 0; i < s.size(); i++){
int temp = remain * from + s[i] - '0';
s[i] = temp / to + '0';
remain = temp % to;
}
int pos = 0;
while('0' == s[pos]){
pos++;
}
return s.substr(pos);
}
string conversion(string s, const int &from, const int &to){
string ret = "";
int remain = 0;
while(0 != s.size()){
s = division(s, from, to, remain);
ret += char('0' + remain);
}
return ret;
}
int main(){
string s = "&quo...
登录后发布评论
六啊