用辗转相除法求两个整数M和N的最大公约数和最小公倍数,用While循环,循环变量i,
用辗转相除法求两个整数M和N的最大公约数和最小公倍数,用While循环,循环变量i,
#include "stdio.h"
#include "math.h"
#include "conio.h"
#include "stdlib.h"
void NONO( int m,int n,int s1,int s2);
main()
{ int m=9,n=84,s1,s2,r;
//
printf("The highest common divisor of %d and %d is %dn",m,n,s1);
printf("The lowest common multiple of %d and %d is %dn",m,n,s2);
NONO(m,n,s1,s2);
}
void NONO(int m,int n,int s1,int s2)
{ FILE *f;
f=fopen("out1.dat","w");
fprintf(f,"%d,%d,%dn",m,n,s1);
fprintf(f,"%d,%d,%dn",m,n,s2);
fclose(f);
}
求修补