Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158893 任艺宸 n的阶乘 C++ Accepted 1 MS 272 KB 384 2026-08-23 11:41:35

Tests(5/5):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int a(int n){ if(n==1)return 1; else return n*a(n-1); } int main(){ int s; cin>>s; cout<<a(s)<<endl; return 0; }