0
Please help me in code coach problem: paint cost
2 Respuestas
0
Buying an odd amount of colours will fail because integer division/ storing the result in an integer will cut off the .5 part, e.g.
1 -> 45 / 10 = 4
3 -> 55 / 10 = 5
so rounding it afterwards has no effect. Also, I would prefer std::ceil() over std::rint() when it comes to rounding a number up.
0
Thanks @Shadow