求最大公因子- –
Tag: 求最大公因子
两个非零整数的最大公因子(欧几里得算法)
int MaxCommonFactor(int a, int b)
{
int r;
while(n!=0)
{
r=(m>=n)?(m-n):m;
m=n;
n=r;
}
return m;
}
Post a comment now »
本文目前不可评论
Sorry, the comment form is closed at this time.
No comments yet.