Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
192 | Benson | n的阶乘 | C++ | Accepted | 0 MS | 256 KB | 285 | 2022-07-22 09:12:32 |
#include<iostream> #include<cstring> #include<cmath> using namespace std; int jiecen(int x) { if(x==1) { return 1; } else { return (jiecen(x-1)*x); } } int main() { int n; cin>>n; cout<<jiecen(n)<<endl; return 0; }