Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128919 | 邓庆凯 | 求最大公约数和最小公倍数 | C++ | 通过 | 100 | 0 MS | 252 KB | 209 | 2024-01-26 11:26:25 |
#include<bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>m>>n; int a,b; a=m;b=n; int r=m%n; while(r!=0){ m=n; n=r; r=m%n; } cout<<n<<endl; cout<<a*b/n; return 0; }