1. //#define _CRT_SECURE_NO_WARNINGS
    2. #include <stdio.h>
    3. #include <math.h>
    4. int main(void)
    5. {
    6. int m, n;
    7. scanf("%d %d", &m, &n);
    8. int yushu;
    9. yushu = m % n;
    10. int x;
    11. x = m * n;
    12. if (yushu == 0) {
    13. printf("%d %d", n, x / n);
    14. }
    15. else {
    16. while (yushu != 0) {
    17. m = n;
    18. n = yushu;
    19. yushu = m % n;
    20. }
    21. printf("%d %d", n, x / n);
    22. }
    23. return 0;
    24. }