Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
132448 | EUCLID | 求最大公约数和最小公倍数 | C++ | 通过 | 100 | 0 MS | 248 KB | 262 | 2024-02-22 13:58:42 |
#include<bits/stdc++.h> using namespace std; int woshi(int a, int b) { int c=1; while (c!=0) { c=a%b; a=b; b=c; } return a; } int main() { int a,b; cin>>a>>b; int n=a*b/woshi(a,b); cout<<woshi(a,b)<<" "; cout<<n<<endl; return 0; }