会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
ying_vincent
博客园
首页
新随笔
联系
管理
订阅
2013年6月24日
Algorithm: Euclid's algorithm of finding GCD
摘要: 寻找最大公约数方法代码如下:1 int gcd (int a, int b) {2 return b ? gcd (b, a % b) : a;3 }应用:求最小公倍数代码如下:1 int lcm (int a, int b) {2 return a / gcd (a, b) * b;3 }
阅读全文
posted @ 2013-06-24 00:42 ying_vincent
阅读(195)
评论(0)
推荐(0)
编辑