#include #include
INT main (void) {Int N, M, I, J, K, TEMP, R, P1, P2; Printf ("Input Two Integers:"); Scanf ("% D% D", & n, & M);
IF (n> m) / * guarantee m n * /
{TEMP = N; n = m; m = Temp;} for (i = 1; i <= n; i ) / * to obtain the maximum number of conventions * / if (M% i == 0 && n% i == 0) R = i; for (j = 1; j <= n; j ) / * solve the least common multiple * / {for (k = 1; k <= m; k ) {p1 = j * m; p2 = k * n ; If (p1 == p2) / *, you can jump out * / Break;}}}} PRINTF ("Maximum number of conventions:% d / n", r); Printf ("Minimum male:% D / N", P1) ;
System ("pause"); return 0;}