1108 最小公倍数
作者:互联网
hdu 1108 最小公倍数
添加链接描述
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y){
return y ? gcd(y, x % y) : x;
}
int lcm(int x, int y){
return x/gcd(x,y)*y;
}
int main(){
int x, y;
while(scanf("%d %d", &x, &y) == 2){
printf("%d\n", lcm(x, y));
}
return 0;
}
标签:return,gcd,公倍数,最小,int,lcm,1108 来源: https://blog.csdn.net/weixin_51663098/article/details/115599952