递归实现指数函数

Posted on 2024-03-31 13:05  v的小猫  阅读(9)  评论(0编辑  收藏  举报

double f(double x,int n)
{double result;
if(n==0){
result=1;}
result=x* f(x,n-1);
return(result);
}

Copyright © 2024 v的小猫
Powered by .NET 9.0 on Kubernetes