Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, m;
- cin >> n >> m;
- int i = n;
- while(i <= n * m) {
- if(i % n == 0 and i % m == 0) {
- cout << i << endl;
- break;
- }
- i++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment