E.实验3_11_最大公约数和最小公倍数
#include<stdio.h>
int main() {
int m, n, min, gy = 1, gb, a, b;
scanf("%d%d", &m, &n);
if (m > n) {
min = n;
} else {
min = m;
}
for (int i = 1; i <= min; i++) {
if ((m % i == 0) && (n % i == 0)) {
gy = i;
} else {
}
}
a = m / gy;
b = n / gy;
gb = a * b * gy;
printf("%d %d", gy, gb);
return 0;
}