View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59