View Code of Problem 59

#include <stdio.h>
int main()
{
	int a,b,c;
	scanf("%d %d",&a,&b);
	if(a>b)
		c=b;
	else 
		c=a;
	while(a%c!=0 || b%c!=0)
	{
		c--;
	}
	printf("%d %d",a*b/c,c);
	return 0;
}

Double click to view unformatted code.


Back to problem 59