Current location - Training Enrollment Network - Mathematics courses - Mathematics and C 10
Mathematics and C 10
Master ()

{

int p,r,n,m,temp

Printf ("Please enter 2 numbers n, m:");

scanf("%d,%d ",& ampn & amp; m); //Enter two positive integers.

If (n & ltM)// put the large number in n and the decimal number in m.

{ temp = n;

n = m;

M = temperature;

}

p = n * m; //P is the product of the original two numbers n and m.

And (m! =0)// Find the greatest common divisor of two numbers n, m 。

{

r = n % m;

n = m;

m = r;

}

printf("Its MAXGongYueShu:%d\n ",n); //Print the greatest common divisor.

Printf("Its min gong Bei number: %d\n ",p/n); Print the least common multiple.