6 条题解

  • 0
    @ 2025-8-10 21:28:44
    #include<bits/stdc++.h>
    using namespace std;
    int n,m,a,b,c;
    int main(){
    	while(cin >> n >> m){
    		a=n;
    		b=m;
    		int ans=m;
    		while(a%b!=0) {
    			c=a%b;
    			a=b;
    			b=c;
    		}
    		cout << b << " " << n*m/(b) << "\n";
    	} 
    	return 0;
    }
    
    
    

    信息

    ID
    977
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    817
    已通过
    223
    上传者