当前位置:网站首页>第一章:递归求n的阶乘n!
第一章:递归求n的阶乘n!
2022-07-03 19:17:00 【股_四】
long fac1(int n)
{
long f;
if (n == 1) f = 1;
else f = n * fac1(n - 1);
return (f);
}
int main()
{
int n;
long y;
printf(" 请输入n(n < 13):");
scanf("%d", &n);
if (n > 12)
{
printf(" 输入的n超出上限12,请重新输入n。\n");
return 0;
}
y = fac1(n);
printf(" %d! = %ld\n", n, y);
return 0;
}
结果:
边栏推荐
- 235. The nearest common ancestor of the binary search tree [LCA template + same search path]
- Floating source code comment (38) parallel job processor
- SSM integration - joint debugging of front and rear protocols (list function, add function, add function status processing, modify function, delete function)
- P1891 crazy LCM (Euler function)
- SQL injection for Web Security (1)
- EGO Planner代码解析bspline_optimizer部分(3)
- Today I am filled with emotion
- Flutter network and data storage framework construction-b1
- KINGS
- UE source code analysis: uccharactermovementcomponent - rootmotion
猜你喜欢

Free year-end report summary template Welfare Collection
![235. Ancêtre public le plus proche de l'arbre de recherche binaire [modèle LCA + même chemin de recherche]](/img/f5/f2d244e7f19e9ddeebf070a1d06dce.png)
235. Ancêtre public le plus proche de l'arbre de recherche binaire [modèle LCA + même chemin de recherche]

01. Preparation for automated office (free guidance, only three steps)
![Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]. StandardContext](/img/56/ea61359dd149a49589ba7ad70812a0.jpg)
Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]. StandardContext

Basic principle of LSM tree

我们做了一个智能零售结算平台
![[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]](/img/a9/d89ee2b88517eea6b3c38d72cf099f.jpg)
[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]

What is the content of game modeling

Record: pymysql is used in pycharm to connect to the database

The installation path cannot be selected when installing MySQL 8.0.23
随机推荐
SSM integration - joint debugging of front and rear protocols (list function, add function, add function status processing, modify function, delete function)
Record: install MySQL on ubuntu18.04
235. The nearest common ancestor of the binary search tree [LCA template + same search path]
Yolov3 network model building
P1891 crazy LCM (Euler function)
A green plug-in that allows you to stay focused, live and work hard
變化是永恒的主題
我们做了一个智能零售结算平台
Pecan — Overview
PyTorch中在反向传播前为什么要手动将梯度清零?
Dart JSON编码器和解码器剖析
The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking
Ego planner code parsing Bspline_ Optimizer section (1)
为什么要做特征的归一化/标准化?
Find the median of two positive arrays
Basic principle of LSM tree
Analysis of dart JSON encoder and decoder
235. 二叉搜索樹的最近公共祖先【lca模板 + 找路徑相同】
Common text labels
flask 生成swagger文档