View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59