题目内容:编写求x的n次方的递归函数,在主函数调用并输出。(x为double型,n为整型,函数类型为double型)
输入格式:
%lf%d
输出格式:
%f
输入样例:
4 3
输出样例:
64.000000
时间限制:500ms内存限制:32000kb
#includedouble power(double x,int n); int main() { double x; int n; scanf("%lf%d", &x,&n); printf("%f", power(x,n)); return 0; } double power(double x,int n){ double a = 1.0; for (int i = 0; i < n; i++) { a *= x; } return a; }



