View Code of Problem 59

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
int main() {
	int a,b,c,ta,tb;
	scanf("%d %d",&a,&b);
	ta=a;
	tb=b;
	int max,min;
	while((c=b%a)!=0){
		a=b;
		b=c;
	}
	max=a;
	min=ta*tb/max;
	printf("%d %d",min,max);
}

Double click to view unformatted code.


Back to problem 59