题解 | #求最小公倍数#
求最小公倍数
https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
#include <any> #include <iostream> using namespace std; int main() { int a,b; while (cin >> a >> b) { // 使得b为较大的数 if(a >b){ swap(a, b); } for(int i = 1; i<=a; i++){ if( (b*i)%a == 0 ){ cout<< b*i<<endl; return 0; } } } } // 64 位输出请用 printf("%lld")