2008年3月31日

最大公约数和最小公倍数的超精简算法

摘要: 计算两个整数最大公约数和最小公倍数的算法:C++语言实现 #include using namespace std; int gcd(int a, int b) //最大公约数 { while(a!=b) { a>b ? a -= a/b * b : b -= b/a * a; } return a; } int lcm(int a, int b) //最小公倍数 { return a * b ... 阅读全文

posted @ 2008-03-31 12:57 Lucky Zheng 阅读(182) 评论(1) 推荐(0)

2008年3月22日

welcome to my world

摘要: it's my new space here! i hope i can wirte my familiar technologies and skills, and whoever has the same interests can join me in the discussion and suggestion. i believe that'll be very fun! 阅读全文

posted @ 2008-03-22 21:55 Lucky Zheng 阅读(110) 评论(0) 推荐(0)

导航