题解 1151: C语言训练-计算一个整数N的阶乘

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

计算一个整数N的阶乘C++版

```cpp#include/*这里也可以用万能头,看看自己的喜爱:#include#include//这里Windows.h不能使用,不然会错*/usingnamespacestd;intmain(){intn;//定义一个整数nlonglongsum=1;//定义sum(n的阶乘),

-计算一个整数N的阶乘

摘要:解题思路:注意事项:参考代码:n=int(input())sum=1for i in range(1,n+1): sum=sum*iprint(sum) &nbs……

简单的自定义阶乘函数

摘要:解题思路:自定义阶乘函数输出即可。本题目给的数据不大,所以不用考虑大数溢出注意事项:参考代码:#include <stdio.h>int factor(int n){ &nbs……