我是一名C语言的初学者,特别是对函数这一章有点模糊!希望各位前辈能够帮助帮助啊!谢谢了啊!
#include<stdio.h>
void main()
{ int zdg(int m,int n);
int zxg(int m,int n,int p);
int m,n,p,t,q;
printf(“please input two data:\n”);
scanf(“%d,%d”,&m,&n);
if(m<n)
{t=m;m=n;n=t;}
p=zdg(m,n);
q=zxg(m,n,p);
printf(“zdg shi %d\n”,p);
printf(“zxg shi %d\n”,q);
}
int zdg(int m,int n)
{ int r;
while((r=m%n)!=0)
{ m=n;
n=r;
return(n);
}
int zxg(int m,int n,int p)
{return m*n/p;}
每次的结果怎么都不对呢!请各位有空看一下啊!
>> 本文固定链接: http://www.vcgood.com/archives/2219