Common and public multiples
/* It is difficult to describe James's problem. Now you need help. The problem is: two positive integers are given to obtain their maximum common approx. And the least common multiples. Enter an integer n (0 <n <= 10000) In the first line, indicating that there are n groups of test data. Then, input two integers I, j (0 <I, j <= 32767 ). Output the maximum and minimum common multiples of each group of test data. Example: 36 612 1133 22. Example: 6 61 13211 66 * // * Hello, World! 36 6 max common approx.: 6 min. common multiples: 612 11 Max common approx.: 1 min. common multiples: 13233 22 Max common approx.: 11 min. common multiples: 66 */# include <stdio. h> // maximum common approx. int gcd (int a, int B) {if (a <B) return gcd (B, a); else if (B = 0) return a; else return gcd (B, a % B);} // minimum public multiple int lcm (int a, int B) {return a * B/gcd (, b);} int main (int argc, const char * argv []) {// insert code here... printf ("Hello, World! \ N "); int a, B, n; scanf (" % d ", & n); while (n> 0) {scanf (" % d ", & a, & B); printf ("maximum common divisor: % d \ n", gcd (a, B); printf ("minimum common multiple: % d \ n ", lcm (a, B); n --;} return 0 ;}