Advertisement
Josif_tepe

Untitled

Dec 15th, 2023
966
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.     int n, m;
  6.     cin >> n >> m;
  7.     int nzs = n * m;
  8.     for(int i = n * m; i >= 1; i -= 1) {
  9.         if(i % n == 0 and i % m == 0) {
  10.             nzs = i;
  11.         }
  12.     }
  13.     cout << nzs << endl;
  14.     return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement