Type: Default 1000ms 256MiB

计算阶乘

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

实现一个计算 n 的阶乘的程序,程序的框架已经写好了,现在需要填入frac函数的定义和实现。

n!=n×(n−1)!

输入格式

第一行输入一个整数n(t≤10)。

输出格式

输出 1 行,输出为n!。

#include <iostream>
using namespace std;
// 从这里开始写代码

int main() {
    int n;
    cin >> n;
    cout << frac(n) << endl;
    return 0;  
}

2024022204

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
10
Start at
2024-2-22 17:00
End at
2024-2-22 18:30
Duration
1.5 hour(s)
Host
Partic.
10