用c语言实现非递归 求n的阶乘

//求n的阶乘
int factorial(int n)
{
int result = 1;
while (n > 1)
{
result *= n ;
n -= 1;
}
return result;
}

发布了55 篇原创文章 · 获赞 85 · 访问量 5156

猜你喜欢

转载自blog.csdn.net/lzh_99999/article/details/100768166