Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41060 Songgy_King 最大公约数、最小公倍数 C++ 通过 0 MS 252 KB 289 2024-02-19 09:35:50

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int gcd(int a,int b) { if(b==0){ return a; } else{ return gcd(b,a%b); } } int main() { int x,y,temp=0; cin>>x>>y; if(x>y){ temp=gcd(x,y); }else temp=gcd(y,x); cout<<temp<<","<<x*y/temp; return 0; }


测评信息: