#include <stdio.h>
#include <stdlib.h>
int gcd(int big, int small)
{
//printf("\n%d %d\n",big,small);
if(small==0) {
//printf("\n최종리턴 : % d %d\n", big, small);
return big;
}
else return gcd(small,big%small);
}
int main(void)
{
int m, n;
printf("정수 두 개:");
scanf("%d %d",&m,&n);
if(m>n)
{
printf("최대공약수:%d",gcd(m,n));
printf("최소공배수:%d",m*n/gcd(m,n)); }
else
{
printf("\n최대공약수 : %d",gcd(n,m));
printf("최소공배수:%d",m*n/gcd(n,m)); }
system("pause");
return 0;
}