Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40927 | Andrew宥杨 | 最大公约数、最小公倍数 | C++ | Accepted | 0 MS | 244 KB | 286 | 2024-02-18 11:24:35 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; int m,n; for(int i=1;i<=min(a,b);i++){ if(a%i==0 && b%i==0){ m=i; } } for(int i=1;i<=40000;i++){ if(i%a==0 && i%b==0){ n=i; break; } } cout<<m<<","<<n; return 0; }