Run ID:193
提交时间:2022-07-22 09:14:19
#include<iostream> using namespace std; int jiecheng(int x) //x是形式参数,只在自定义函数内起作用 { if(x==1) //递归函数的结束条件 return 1; else return jiecheng(x-1)*x;//递归函数的关系式 } int main(){ int x; cin>>x; cout<<jiecheng(x); return 0; }