版本比较
B3619 题解
正文
增加 4 行删除 4 行
18 行未改动1920212223232425262722 行未改动505152535454555657575859606162636464656667685 行未改动18 行未改动具体如下:
```cppstring ans = ""; //存储答案。while (n != 0) //模拟短除法。 while (n != 0) //模拟短除法。{ ans += dict[n % x]; n /= x;}22 行未改动#include <iostream>#include <cstdio>using namespace std;string dict = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ten_to_x(int n, int x) //十进制转 x 进制函数。 string ten_to_x(int n, int x) //十进制转 x 进制函数。{ string ans = ""; while (n != 0) //模拟短除法。 while (n != 0) //模拟短除法。 { ans += dict[n % x]; n /= x; } string t = ""; //倒取余数。 for (int i = ans.length()-1; i >= 0; i--) t += ans[i]; return t; return t;}int main(){ int n, x;5 行未改动