View Code of Problem 59

#include<stdio.h>
int main()
{
	int a,b,x,y,c,t;
	scanf("%d%d",&a,&b);
	x=a;
	y=b;
	c=a%b;
	while(c)
	{
		a=b;
		b=c;
		c=a%b;
	}
	printf("%d %d",x*y/b,b);
}

Double click to view unformatted code.


Back to problem 59