Problem1915--递归实现指数函数

1915: 递归实现指数函数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现一个计算x ​n ​​ (n≥1)的函数。 函数接口定义: double calc_pow( double x, int n ); 函数calc_pow应返回x的n次幂的值。建议用递归实现。题目保证结果在双精度范围内。 裁判测试程序样例: #include double calc_pow( double x, int n ); int main() { double x; int n; scanf(

Input

双精度浮点数x,次数n

Output

函数calc_pow应返回x的n次幂的值。建议用递归实现。题目保证结果在双精度范围内。

Sample Input Copy

2 3

Sample Output Copy

8

Source/Category

320