Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
13123 祝易涛 C语言6.10 C++ Accepted 1 MS 732 KB 316 2021-05-25 16:17:40

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int n,m,r,j,i=1,s,k,temp; cin>>n>>m; s=n; k=m; r=n%m; while(r!=0) { n=m; m=r; r=n%m; } cout<<m<<" "; if(s>k) { temp=s; s=k; k=temp; } j=k*i; while(j%s!=0) { i++; j=k*i; } cout<<j; return 0; }