recursive real function Factorial(n) result(out)
integer :: n
if ((n==0).or.(n==1))then
out = 1
else
out = n * Factorial(n - 1)
end if
end function Factorial
Fortran 实现简单的递归程序
最新推荐文章于 2024-05-09 23:36:34 发布