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
54
u/zone_31 Sep 14 '18
Hardcode it with a switch statement. The compiler will make it into a jump table, making it crazy fast!