Josif_tepe

Untitled

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