#include <iostream>
// 递归函数计算阶乘
unsigned int factorial(unsigned int n)
{
if (n == 0
模板基础 template C/C++】使用递归实现阶乘计算
最新推荐文章于 2024-08-31 06:24:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
#include <iostream>
// 递归函数计算阶乘
unsigned int factorial(unsigned int n)
{
if (n == 0