全部评论 3

  • 这道题用递归会不会更快(题解已发

    2023-07-31 来自 广东

    1
  • #include <iostream>
    using namespace std;
    int a,b;
    int f(int x,int y){
    if(x%y == 0) return y;
    return f(y,x%y);
    }
    int main(){
    cin >> a>>b;
    cout <<"GCD="<< f(a,b) <<endl;
    cout <<"LCM="<< a*b/f(a,b);
    return 0;
    }

    2024-12-26 来自 浙江

    0
  • 文明的法姐(

    2023-12-23 来自 广东

    0
首页