Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
128700 | 林麒瑞 | 求最大公约数和最小公倍数 | C++ | Accepted | 100 | 0 MS | 248 KB | 212 | 2024-01-26 08:55:43 |
#include<bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>m>>n; int a=n; int b=m; int r=m%n; while(r!=0){ m=n; n=r; r=m%n; } cout<<n<<" "<<b*a/n; return 0; }