学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
发新话题
打印

求助 简单程序 无法看清

求助 简单程序 无法看清

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int m=245;
            int n=60;
            int s;
            while (n!=0)
            {
            s=m%n;
            m=n;   
            n=s;
            }
            Console .WriteLine ('最大公约数:{}",m)
        }
}
我想要代码停留在最后的结果上面  希望各位网友帮帮忙  说下该怎么实现

TOP

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int m=245;
            int n=60;
            int s;
            while (n!=0)
            {
            s=m%n;
            m=n;   
            n=s;
            }
            Console .WriteLine ("最大公约数:{0}",m);
            Console .Read();
        }
   }
}

[ 本帖最后由 bleach46 于 2008-5-10 16:34 编辑 ]

TOP

发新话题