Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44961 | 奚晨瑞 | 递归求阶乘 | C++ | Accepted | 1 MS | 248 KB | 211 | 2024-04-07 15:16:52 |
#include<iostream> using namespace std; int m(int n){ if(n==0){ return 1; } if(n==1){ return 1; } else{ return m(n-1)*n; } } int main() { int n; cin>>n; cout<<m(n); return 0; }