最小公倍数

    xiaoxiao2021-03-25  103

    #include <iostream> int main() { long long int a, b; std::cin >> a; std::cin >> b; if (a<b) { int temp = a; a = b; b = temp; } long long int s; long long int t1 = a; long long int t2 = b; while (b != 0) { s = a; a = b; b = s%b; } long long int c; c = t1*t2 / a; std::cout << c; return 0; } }
    转载请注明原文地址: https://ju.6miu.com/read-24781.html

    最新回复(0)