| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 448 人关注过本帖
标题:求助 简单程序 无法看清
只看楼主 加入收藏
haibo5210
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2008-5-7
收藏
 问题点数:0 回复次数:1 
求助 简单程序 无法看清
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)
        }
}
我想要代码停留在最后的结果上面  希望各位网友帮帮忙  说下该怎么实现
搜索更多相关主题的帖子: 公约数 
2008-05-10 11:36
bleach46
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2008-4-17
收藏
得分:0 
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();
        }
   }
}

[[it] 本帖最后由 bleach46 于 2008-5-10 16:34 编辑 [/it]]
2008-05-10 16:26
快速回复:求助 简单程序 无法看清
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033900 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved