文章
1
粉丝
176
获赞
0
访问
4.3k
#include <stdio.h>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;
string Convert(string num, int m, int n){
string ans = "";
int remainder,current;
int len = num.length();
for(int i=0;i<len;){ //字符串除法
remainder = 0;
for(int j=0;j<len;j++){
current = remainder*m+num[j]-'0';
num[j] = current/n+'0';
remainder = current%n;
}
if (remainder<=9&&remainder>=0)//拼凑余数,所得字符串为反序
...
登录后发布评论
暂无评论,来抢沙发