gcd
2016-07-13 20:06
225 查看
求最大公约数
gcd(int a, int b)
return b==0 ? a : gcd(b, a%b);
最公小倍数: a*b/gcd(a,b);
gcd(int a, int b)
return b==0 ? a : gcd(b, a%b);
最公小倍数: a*b/gcd(a,b);
相关文章推荐
- javascript原理系列— new的原理
- 将 Web 应用性能提高十倍的10条建议
- 设计模式之c++实现(三)
- android自定义 数字键盘2
- Linux基础(9)文本处理三剑客之grep
- 转:理解 Linux 的硬链接与软链接
- windows apache开启url rewrite
- 关于UITextFiled,UIlabel,UIBUtton相关设置,边框设置和字体设置
- day_3-acm贪心(sort结构体排序)
- python列表常见方法
- Ex2010-18 Exclude email address/recipient from Exchange 2010 dynamic distribution group
- C语言的值传递、地址传递、引用传递
- Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2) E DFS
- 网页设计的字体
- 判断一个年份是否是闰年Java初级入门
- HDU2521 求因数个数
- Nginx配置文件nginx.conf中文详解
- LeetCode - 39. Combination Sum
- [bash]fgrep
- POJ 1952 Buy Low,Buy Lower