http://www.tzcoder.cn/acmhome/problemdetail.do?&method=showdetail&id=6198
c++
#include<bits/stdc++.h> using namespace std; #define MAXN 3005 int t[MAXN],A[MAXN]; char OldData[MAXN], NewData[MAXN],oldData[MAXN]; int olds, news; void trans() { int i, len, k; memset(t,0,sizeof t); memset(A,0,sizeof A); len = strlen(OldData); for(i=len; i>=0; --i) t[len-1-i] = OldData[i] - (OldData[i]<58 ? 48 : OldData[i]<97 ? 55 : 61); for(k=0; len;) { for(i=len; i>=1; --i) { t[i-1] += t[i]%news*olds; t[i] /= news; } A[k++] = t[0] % news; t[0] /= news; while(len>0 && !t[len-1]) --len; } NewData[k] = '