int gcd(int a,int b)
{
if(b==0)
return a;
return
gcd(b,a%b);
}
int lcm(int a,int b){
return a*b/gcd(a,b);
}
int main()
{
int n,m;
while(cin>>n>>m)
{
cout<<gcd(n,m)<<endl;
cout<<lcm(n,m)<<endl;
}
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-32759.html