![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
宁静致远+
天道酬勤
展开
-
2.最大公约数/最小公倍数
//函数调用的方式实现最大公约数/最小公倍数 #include<stdio.h> int fun1(int x,int y) { int t,r; if(x<y) { t=x;x=y;y=t;}//满足条件 :交换两个值 r=x%y; while(r!=0) { x=y; y=r; r=x%y; } return y; } int fun2(int x,int y) { int m; m=x*y/fun1(x,y); return m;} void main()原创 2021-05-07 15:35:47 · 74 阅读 · 0 评论 -
1.年龄递归
#include<stdio.h> int fun(int n){ int s; if(n==1) s=10; if(n>1) s=fun(n-1)+2; return s; } void main() { printf("%d",fun(5)); }原创 2021-05-07 12:46:27 · 87 阅读 · 0 评论