标题:递归 求最大公约数?为什么不能运行?
取消只看楼主
MuMuLee
Rank: 1
等 级:新手上路
帖 子:47
专家分:0
注 册:2016-1-16
结帖率:84.21%
已结贴  问题点数:10 回复次数:1 
递归 求最大公约数?为什么不能运行?
程序代码:
#include
#include 

int gys(int m,int n)
{
   if(n%m==0)
   return m;
   else
   return gys(m,n%m);
}

int main()
{
    int a;
    while(scanf("%d",&a)!=EOF)
    {
        int b,c;
        scanf("%d",&b);
        c=gys(a,b);
        printf("%d",c);
    }
    return 0;
}

搜索更多相关主题的帖子: include include 公约数 公约数 color color 
2016-02-21 22:39
MuMuLee
Rank: 1
等 级:新手上路
帖 子:47
专家分:0
注 册:2016-1-16
得分:0 
回复 3楼 wmf2014
【感谢】
2016-02-22 08:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-461842-1-1.html




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

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