7 條題解

  • -3
    @ 2025-2-22 20:04:41
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    int a,b,c,x,y;
    cin>>x>>y;
    a=x;
    b=y;
    while(a%b!=0)
    {
    	c=a%b;
    	a=b;
    	b=c;
     } 
     cout<<x*y/b<<" "<<b;
    	return 0;
    }
    

    資訊

    ID
    2155
    時間
    1000ms
    記憶體
    64MiB
    難度
    1
    標籤
    遞交數
    149
    已透過
    62
    上傳者