Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41054 | Songgy_King | 最大公约数、最小公倍数 | C++ | Accepted | 0 MS | 248 KB | 239 | 2024-02-19 09:31:48 |
#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 m,n; cin>>m>>n; int num=gcd(m,n); cout<<num<<","<<m*n/num; return 0; }