直接递归,啥也不用管。
void atb(int base,int num){ ... atb(base,num/base); ... cout<<char('A'+num%base-10); ... }