题解 | #计算一个数的阶乘#

计算一个数的阶乘

http://www.nowcoder.com/practice/b0423a89826c4d68a3e8b9832a6a1f49

#include <iostream>
using namespace std;

int main() {
    
    int n;
    cin >> n;
    long long factorial = 1;
    
    // write your code here......
    for(int i=2;i<=n;i++) factorial *= i;

    cout << factorial << endl;
    
    return 0;
}
全部评论

相关推荐

07-07 12:47
门头沟学院 Java
码农索隆:竟然还真有卡体检报告的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务