进制转换板子
ti
#include<bits/stdc++.h>using namespace std;string ss = "0123456789ABCDEF";
int a, b;
string s;int main()
{cin>>a>>s>>b;string str = "";int len = s.length();for(int i = 0; i < len; ){int k = 0;for(int j = i; j < len; j ++ ){int m;if(s[j] >= 'a') m = s[j] - 'a' + 10;else if(s[j] >= 'A') m = s[j] - 'A' + 10;else m = s[j] - '0';int t = a * k + m;s[j] = t / b + '0';k = t % b;}str += ss[k];while(s[i] == '0') i ++ ;}reverse(str.begin(), str.end());cout<<str<<endl;return 0;
}