View Code of Problem 59

#include<stdio.h>
int main()
{
    int m,n,p,r,t;
    scanf("%d%d",&m,&n);
    while(m<n)
    {
        t=m;
        m=n;
        n=t;
    }
    p=m*n;
    while(n!=0)
    {r=m%n;
    m=n;
    n=r;}
    printf("%d %d",p/m,m);
    return 0;
}

Double click to view unformatted code.


Back to problem 59