剑指OFFER 数值的整数次方
class Solution {
public:
double Power(double base, int exp) {
double res = 1;
if(exp >= 0)
{
for(int i=0;i<exp;i++)
{
res *= base;
}
}else{
for(int i=0;i<abs(exp);i++)
{
res /= base;
}
}
return res;
}
};