发表于: java/j2ee | 作者: | 日期: 2008/11/07 02:11
标签:

求最大公因子- –
Tag: 求最大公因子

两个非零整数的最大公因子(欧几里得算法)

int MaxCommonFactor(int a, int b)

{

int r;

while(n!=0)

{

r=(m>=n)?(m-n):m;

m=n;

n=r;

}

return m;

}

: https://blog.darkmi.com/2008/11/07/385.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.