View Code of Problem 59

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

Double click to view unformatted code.


Back to problem 59