Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96127 | 任斌 | 最大公约数和最小公倍数 | C++ | Accepted | 1 MS | 272 KB | 266 | 2024-11-03 09:23:50 |
#include<bits/stdc++.h> using namespace std; int gys(int a,int b){ if(b==0) return a; else return gys(b,a%b); } int gbs(int a,int b){ return a*b/gys(a,b); } int main() { int x,y; cin>>x>>y; cout<<gys(x,y)<<" "<<gbs(x,y)<<endl; return 0; }