class Solution { public: double Power(double base, int exponent) { if(exponent<0){ base=1/base; exponent=-exponent; } double fin=1.0; for(int i=0;i<exponent;i++){ fin=fin*base; } return fin; } };