emm......你们有带钱吗 • 1个月前
#include<bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int gcd,lcm;
int gcdcalc(int n,int m){
if(n%m==0){
return m;
}
return gcdcalc(m,n%m);
}
int main(){
int n,m;
cin>>n>>m;
gcd=gcdcalc(n,m);
lcm=n/gcd*m/gcd*gcd;
printf("%d %d",gcd,lcm);
return 0;
}
评论:
请先登录,才能进行评论