#include<iostream>
using namespace std;
class myclass{
public:
int measure1(int x, int y){
int z=y;
while(x%y!=0){
z=x%y;
x=y;
y=z;
}
return z;
}
int measure2(int x, int y){
int temp;
temp=x*y/measure1(x, y);
return temp;
}
};
int main(){
int m,n;
cin>>m>>n;
myclass mc;
cout<<mc.measure1(m, n)<<endl<<mc.measure2(m, n)<<endl;
return 0;
}
最大公约数和最小公倍数
最新推荐文章于 2023-05-15 23:41:16 发布