View Code of Problem 59

#include <stdio.h>
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int m,n;
    m = a;
    n = b;
    int c;
    while(n){
        c = m%n;
        m = n;
        n = c;
    }
    printf("%d %d\n",a*b/m,m);
    return 0;
}

Double click to view unformatted code.


Back to problem 59