r/shittyprogramming • u/FritangadeLuka420 • Sep 14 '18
Beginning in C++
I'm working in a small homework and the last step is calculate the least common multiple but with easy steps like if or something like that, could someone help me?
14
Upvotes
View all comments
7
u/bolche17 Sep 14 '18
Bruteforcing it is always a option. Just do a for that loops through all the numbers until the product of the denominators and break it if you find a number divisible by both