欧几里德算法

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 欧几里德算法CSharp
{
    class Program
    {
        static int gcd(int a, int b)
        {
            if (b == 0)
                return a;
            else
                return gcd(b, a % b);
        }
        static void Main(string[] args)
        {
            Console.WriteLine(gcd(200, 55));
        }
    }
}

posted on 2010-05-29 15:00  小橋流水  阅读(167)  评论(0编辑  收藏  举报

导航