#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int fun(int m, int n)
{
if (m%n == 0)
{
return n;
}
else
{
return fun(n, m%n);
}
}
void main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("\n最大公约数=%d,最小公倍数=%d", fun(a, b), a* b / fun(b, a));
system("pause");
}
#include <stdio.h>
int fun(int m, int n)
{
if (m%n == 0)
{
return n;
}
else
{
return fun(n, m%n);
}
}
void main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("\n最大公约数=%d,最小公倍数=%d", fun(a, b), a* b / fun(b, a));
system("pause");
}