View Code of Problem 59

#include <stdio.h>
int main(){
	int a,b,c,d;	//4 6 12 2
	scanf("%d %d",&a,&b);
	c=a*b;
	while(a%b!=0){
		d=a%b;		//余数 
		a=b;
		b=d;	
	}
	printf("%d %d",b,c/b);
	return 0;
}

Double click to view unformatted code.


Back to problem 59