Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128723 | Microsoft | 求最大公约数和最小公倍数 | C++ | 通过 | 100 | 0 MS | 248 KB | 195 | 2024-01-26 09:06:17 |
#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; int c=a,d=b; int r=a%b; while(r!=0){ a=b; b=r; r=a%b; } cout<<b<<" "<<c*d/b; return 0; }