输出结果是-858993460;怎么回事啊???
#include<stdio.h>void main()
{
int maxy(int x,int y);
int minb(int x,int y);
int a,b,h,g;
printf("please intput two numbers:\n");
scanf("d%d",&a,&b);
h=maxy(a,b);
printf("最大公约数是%d\n",h);
g=minb(a,b);
printf("最小公倍数是%d\n",g);
}
int maxy(int x,int y)
{
int i,h,t;
if (x>y)
{
t=x;
x=y;
y=t;
}
else
{
x=x;
y=y;
}
for(i=1;i<=x;i++)
{
if(x%i==0 && y%i==0)
h=i;
}
return(h);
}
int minb(int x,int y)
{
int j,g,t;
if (x>y)
{
t=x;
x=y;
y=t;
}
else
{
x=x;
y=y;
}
for(j=y;j<=x*y;j++)
{
if(j%x==0 && j%y==0)
{g=j;break;}
}
return(g);
}
输出结果是-858993460;怎么回事啊???我觉得没问题啊