Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41060 | Songgy_King | 最大公约数、最小公倍数 | C++ | Accepted | 0 MS | 252 KB | 289 | 2024-02-19 09:35:50 |
#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; }