View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59