Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
3348 liumingxuan 最大公约数、最小公倍数 C++ 通过 0 MS 244 KB 400 2023-01-01 15:53:13

Tests(1/1):


#include<iostream> #include<algorithm> #include<cstdio> #include<queue> #include<stack> #include<cstring> using namespace std; int gcd(int a,int b){ if(b==0)return a; return gcd(b,a%b); } int main(){ int a,b; cin>>a>>b; int g=gcd(a,b); printf("%d,%d",g,a*b/g); return 0; } /* #include<cstdio> freopen("文件名.in","r",stdin); freopen("文件名.out","w",stdout); */


测评信息: