提交时间:2024-11-10 18:46:40

运行 ID: 56372

#include<iostream> using namespace std; int main() { int a,b,a0,b0; cin>>a>>b; a0=a; b0=b; while(a0*b0!=0) { if(a0>=b0) a0%=b0; else b0%=a0; } if(a0==0) a0=b0; cout<<a0<<","<<a*b/a0; return 0; }