@@ -0,0 +1,510 @@
+package Pow_x_n;%0A%0A/**%0A * Implement pow(x, n).%0A */%0Apublic class Solution %7B%0A%0A    private double powFor(double x, long n) %7B%0A        if (n %3C 0) %7B%0A            return 1 / powFor(x, n * -1);%0A        %7D%0A        if (n == 0) return 1.0;%0A        if (n == 1) return x;%0A        double half = powFor(x, n / 2);%0A        if (n %25 2 == 1) %7B%0A            return half * half * x;%0A        %7D else %7B%0A            return half * half;%0A        %7D%0A    %7D%0A%0A    public double myPow(double x, int n) %7B%0A        return powFor(x, (long) n);%0A    %7D%0A%7D

50. Pow(x, n)