Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m, n;
- cin >> m >> n;
- int result = 0;
- //fr****************************************
- for (int i = 1; ; i++)
- {
- //if----------------------------------------
- if ((i%m == 0) && (i%n == 0)) //unless i is divisible by both m and n, won't print RES; if by both (which makes sense), then print
- {
- result = i;
- break;
- }
- //if----------------------------------------
- }
- //fr****************************************
- cout << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement