View Code of Problem 59

#include<stdio.h> 
#include<string.h>
#include<math.h>

int main(){ 
    int i,j,n,m;
    scanf("%d %d",&n,&m);
    int t=m*n;
    int z;
    while(m>0){
    	z=n;
    	n=m;
    	m=z%m;
	}
	printf("%d %d",t/n,n);
    return 0; 
     
}

Double click to view unformatted code.


Back to problem 59