用递归求最大公约数
来源:互联网 发布:铝塑板折边工具淘宝 编辑:程序博客网 时间:2024/05/23 18:32
#include <stdio.h>int GCD_C(int a,int b){if(a % b != 0){int z;z = a;a = b;b = (z % b);return GCD_C(a,b);}else {printf("辗转相除法求最大公约数:%d\n",b);return;}}int GCD_J(int x,int y){if(x - y < 0){y = y - x;return GCD_J(x,y);}if(x - y > 0){x = x - y;return GCD_J(x,y);}if(x - y == 0) {printf("辗转相减法求最大公约数:%d\n",y); return;}}int main(){int a,b;printf("请输入2个正整数:");scanf("%d %d",&a,&b);GCD_C(a,b);GCD_J(a,b);return;}
- 用递归求最大公约数
- 用递归求最大公约数
- 用递归法求最大公约数
- 用递归法求最大公约数
- 用递归函数求最大公约数
- 第十二周用递归求最大公约数
- 求最大公约数 Java递归
- 递归求最大公约数
- 递归---求最大公约数
- 求最大公约数(递归)
- 递归求最大公约数
- 递归求最大公约数等
- 递归求最大公约数
- 递归求最大公约数
- 递归法求最大公约数
- 递归求最大公约数
- 欧几里得法递归求最大公约数
- 求最大公约数(递归法)
- UVa 79 ClockHands (water ver.)
- nyoj-660-逃离地球
- js跨浏览器将字符串转化为xml对象
- 测试流程规范
- Amazon Campus(2013-Sep-24)Question 2 / 2 (Amazon Campus(17):Find the differences of items in amazon)
- 用递归求最大公约数
- poj 2942 (点双联通+判断二分图)
- scanf()函数的用法和实践
- PHP验证码图片在各类平台中的应用
- VMware’s Strategy for Software-Defined Storage
- json 简介
- 99乘法表打印
- Oracle索引分类
- table标题栏悬浮一直显示