View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59