提交时间:2024-05-25 14:43:23
运行 ID: 148764
#include<iostream> using namespace std; int main() { int m,n; cin>>m>>n; int a,b; a=m,b=n; int r=m%n; while(r!=0) { m=n; n=r; r=m%n; } cout<<n<<" "<<(a*b/n)<<endl; return 0; }