Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96126 刘老师 最大公约数和最小公倍数 C++ Accepted 1 MS 268 KB 261 2024-11-03 09:23:20

Tests(1/1):


Code:

#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; }