code
1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace AlgorithmBase 6{ 7 public class MaxCommonDivisor 8 { 9 public static int GetMaxCommonDivisor(int m,int n)10 {11 if (m < n)12 {13 int temp = m;14 m = n;15 n = temp;16 }1718 int r = m % n;1920 while (r != 0)21 {22 m = n;23 n = r;24 r = m % n;25 }2627 return n;28 }29 }30}
转载于:https://www.cnblogs.com/nanshouyong326/archive/2007/05/21/753919.html
转载请注明原文地址: https://win8.8miu.com/read-1483009.html