.
bool IsPow(int a,int b) { if(a<=0||b<=0) return false; while (a%b==0) { a=a/b; } if (a==1)return true; else return false; }