小题解
2024-12-26 16:08:19
发布于:浙江
1阅读
0回复
0点赞
#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;
}
这里空空如也
有帮助,赞一个