标题:求教 哪里出错了?编译没问题,运行不了。 求公倍公约的 如果有更好的方 ...
取消只看楼主
thelastone
Rank: 2
等 级:论坛游民
帖 子:14
专家分:14
注 册:2013-11-23
结帖率:100%
已结贴  问题点数:20 回复次数:2 
求教 哪里出错了?编译没问题,运行不了。 求公倍公约的 如果有更好的方法麻烦说下
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int gongyue(int,int);
    int gongbei(int,int,int);
    int a,b,h,i;
    printf("input two number:\n");
    scanf("%d,%d",&a,&b);
    h=gongyue(a,b);
    printf("h=%d\n",h);
    i=gongbei(a,b,h);
    printf("%d\n",i);
    system("PAUSE");
    return 0;
}
int gongyue(int a,int b)
{
    int c,d;
    if(b>a)
    {
           c=a;a=b;b=c;
    }
    while((d=a%b)!=0)
    {
            a=b;
            b=d;
    }
    return (d);
}
int gongbei(int a,int b,int h)
{
    return (a*b/h);
}
搜索更多相关主题的帖子: include system number return 
2014-01-03 15:12
thelastone
Rank: 2
等 级:论坛游民
帖 子:14
专家分:14
注 册:2013-11-23
得分:0 
回复 3楼 韶志
请问    我的那个错在哪里了?
2014-01-05 01:21
thelastone
Rank: 2
等 级:论坛游民
帖 子:14
专家分:14
注 册:2013-11-23
得分:0 
回复 2楼 mic123
请问我的是错在哪里了
2014-01-05 01:23



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




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

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