提交时间:2024-02-18 11:53:14

运行 ID: 40970

#include<bits/stdc++.h> using namespace std; int gcd(int a,int b) { if(b==0){ return a; } else{ return gcd(b,a%b); } } int main() { int x,y,temp=0; cin>>x>>y; if(x>y){ temp=gcd(x,y); }else temp=gcd(y,x); cout<<temp<<","<<x*y/temp; return 0; }