View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59