View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59