class Solution { public: double Power(double b, int e) { double res=1.0; if(b==0)return 0; if(e==0)return 1; for(int i=1;i<=abs(e);i++) res*=b; return e>0?res:1.0/res; } };