class Solution {
public double Power(double base, int exponent) {
if(base==0)
return 0;
else if(exponent==0)
return 1;
else{
double result = 1.0;
for(int i =1;i<=Math.abs(exponent);i++){
result *=base;
}
return exponent<0? 1/result : result;
}
}
}
根据题目应该不能使用Math吧