标签:
1 class Solution { 2 public: 3 double Power(double base, int exponent) { 4 double x=1; 5 for(int i=0;i<abs(exponent);i++) 6 { 7 x*=base; 8 } 9 if(exponent<0) 10 return 1/x; 11 else 12 return x; 13 } 14 };
标签:
原文地址:http://www.cnblogs.com/SeekHit/p/5760361.html