#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int find_tmax(int m,int n);
int find_tmin(int x,int y);
int a,b,c;
cout<<"please input two numbers:";
cin>>a>>b;
if(b>a)
{
c=b;
b=a;
a=c;
}
cout<<a<<"和"<<b<<"的最大公约数为:"<<find_tmax(a,b)<<endl;
cout<<a<<"和"<<b<<"的最小公倍数为:"<<find_tmin(a,b)<<endl;
return 0;
}
int find_tmax(int m,int n)
{
int r;
while(n!=0)
{
r=m%n;
m=n;
n=r;
}
return m;
}
int find_tmin(int x,int y)
{
int p,q;
p=x*y;
q=p/find_tmax(x,y);
return q;
}