思路:辗转相除法,n%k得余数,
class Solution { public: int sumBase(int n, int k) { int res=0; while(n)res+=n%k,n/=k; return res; } };