文章
246
粉丝
0
获赞
1202
访问
193.8k
#include<iostream> using namespace std; int gcd(int a,int b) { return b==0 ? a : gcd(b,a%b); } int main() { int a,b; cin>>a>>b; if(a<b) swap(a,b); int res1=gcd(a,b); int res2=a*b/res1; cout<<res1<<" "<<res2; return 0; }
登录后发布评论
暂无评论,来抢沙发