Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
128680 黄曦 求最大公约数和最小公倍数 C++ 通过 100 0 MS 248 KB 192 2024-01-26 08:50:27

Tests(3/3):


#include<bits/stdc++.h> using namespace std; int main() { int m,n,r,a,b; cin>>m>>n; a=m; b=n; r=m%n; while(r!=0) {m=n; n=r; r=m%n;} cout<<n<<" "<<a/n*b; return 0; }


测评信息: