convert integer to another base
void convert_base(int n, int b) { stack<int> stk; while(n != 0) { stk.push(n % b); n /= b; } while(!stk.empty()) { cout << stk.top(); stk.pop(); } }