首页
软件开发
登录
6mi
u
盘
搜
搜 索
软件开发
最大公约数
最大公约数
xiaoxiao
2022-07-06
201
#include<iostream> #include<cstring> using namespace std; int gcd(int a,int b) { if(a==0) { return b; } else if(b==0) { return a; } else{ return gcd(b,a%b); } } int main() { int a,b; while(cin>>a>>b) { cout<<a*b/gcd(a,b)<<endl; } return 0; }
转载请注明原文地址: https://yun.8miu.com/read-26387.html
最新回复
(
0
)