Pow(x, n)

Desicription

Implement pow(x, n).

Example 1:

1
2
Input: 2.00000, 10
Output: 1024.00000

Example 2:

1
2
Input: 2.10000, 3
Output: 9.26100

Solution

1
2
3
4
5
6
class Solution {
public:
double myPow(double x, int n) {
return pow(x, n);
}
};