Advertisement
Josif_tepe

Untitled

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