递归实现指数函数
作者:互联网
https://pintia.cn/problem-sets/12/problems/353
1 double calc_pow(double x, int n) 2 { 3 double ret; 4 5 if (n == 0) 6 { 7 ret = 1; 8 } 9 else 10 { 11 ret = x * calc_pow(x, n - 1); 12 } 13 14 return ret; 15 }
标签:指数函数,12,cn,递归,实现,double,ret,pow,calc 来源: https://www.cnblogs.com/2018jason/p/12233365.html