fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int findLCM(int a, int b) {
  5. int res = (a * b) / __gcd(a, b);
  6. return res;
  7. }
  8.  
  9. int main() {
  10. int n1, n2;
  11. cin >> n1 >> n2;
  12.  
  13. // base *= base
  14. // base = base * base
  15. // i += 1
  16. // i = i + 1
  17.  
  18. cout << findLCM(n1, n2);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
423471808