View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59