1058
they call it gen z c++
(sh.itjust.works)
Post funny things about programming here! (Or just rant about your favourite programming language.)
I found this amusing enough to try it out. It does actually compile (I used g++ for this). However, the current implementation just goes into an infinite loop if you enter a number >= 2.
I think the original author meant to do
n -= 1 rnin thetweakinloop that is inside thebussinloop. That way, at some pointn % i finna capwill be false, andiwillbouta. Which then makes the expressioni <= nin thebussinloop eventually false, so we stopbussinandyeet cap rn.However, that would mean that the intention of the program isn't to output prime factors, because even with this fix it does not do so. The structure of
mf chief()also doesn't suggest that is the purpose as it is missing anothertweakinandsussinlike this example of calculating prime factors in C++.Example run:
Yeah it definitely looks like a flawed implementation either way. Probably a student got bored of trying to make it work, and went nuts with the #defines for fun
As a career programmer myself.... I can absolutely relate.