View Code of Problem 59

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void main(){
	int a,b,n1,n2,team;
	scanf("%d %d",&a,&b);
	if(a<b){
	team=a;
	a=b;
	b=team;
	}
	n1=a;
	n2=b;
	while(n1!=0){
	team=n1%n2;
	n1=n2;
	n2=team;
	}
	printf("%d ",n1);
	printf("%d\n",a*b/n1);
	
}

Double click to view unformatted code.


Back to problem 59