Advertisement
Josif_tepe

Untitled

Jan 27th, 2024
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int a, b;
  7.     cin >> a;
  8.     cin >> b;
  9.    
  10.     for(int i = 1; i <= a * b; i += 1) {
  11.         if(i % a == 0 and i % b == 0) {
  12.             cout << i << endl;
  13.             return 0;
  14.         }
  15.     }
  16.    
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement