2013年10月10日

摘要: /*Filename:gcd.cpp *//*计算两个数的公约数*//*原理:反转相减法*/#includeusing namespace std;int gcd(int a,int b){ int big = a > b?a:b; int small = a > b?b:a; int result = 2; while((result != 1)&&(result != 0)){ result = big - small; big = result > small?result:small; small = result > small?small:r 阅读全文
posted @ 2013-10-10 10:26 程序猿猿猿 阅读(247) 评论(0) 推荐(0)

导航