(C syntax) Minimum Public multiple, c syntax 24 minimum public multiple
Knowledge point:
Algorithm
While loop usage.
Content: returns the minimum public multiple of two natural numbers.
Input description:
Output description:
Input example:
2 4
Output example:
4
1 # include <stdio. h> 2 int main () 3 {4 int a, B, t, A, B; 5 scanf ("% d", & a, & B ); 6 A = a; 7 B = B; 8 do 9 {10 t = a % B; 11 a = B; 12 B = t; 13} 14 while (t! = 0); 15 printf ("% d \ n", A * B/a); 16 return 0; 17}
The minimum public multiples of A, B, and C are 24, the minimum public multiples of B and C are 40, and the minimum public multiples of A and C are 30, which is A, B, and C?
A = 3, B = 8; C = 10
If the minimum public multiples of A and B are 24, the following possibilities may be [, X], [24, 1, X], [, X], [, X]
The minimum public multiples of B and C are 40. Combined with the above analysis, it is possible to [24, 1, 40], [3, 8, 5], [3, 8, 10], [3, 8, 20], [3, 8, 40]
If the minimum public multiple of A and C is 30, The result [, 10] is obtained based on the previous analysis]
The maximum public factor of two numbers is 4 and the minimum public factor is 24. The two numbers cannot be () A4 and 24 B8 and 12 c8 and 24
C
The maximum public factor of C is 8.
Wish you progress \ (^ o ^ )/~