[Solved] C# Paint Cost | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

[Solved] C# Paint Cost

I can't seem to solve the "Paint Cost" assignment 😐 I have used three different strategies, I read previous posts, and I think I got it all. The conversion to int. The rounding up. Still, the last one fails, even when I do the rounding myself 😐 Some help would be appreciated 🙂🤗 Here is my attempt: https://code.sololearn.com/ckjpaT94fiO7

10th Oct 2021, 7:52 AM
Agnes Ahlberg
Agnes Ahlberg - avatar
2 Answers
+ 4
The last test case is probably just some huge value which caused an overflow in your calculations, because if I replace int by long in your tax strategies, most of them work fine now (except for the first, where the multiplication by 1.1 is not precise). The following should be working: https://code.sololearn.com/c1poPHhKGrh3/?ref=app
10th Oct 2021, 8:36 AM
Shadow
Shadow - avatar
+ 3
Thank you 🤗💕 Yes, I did not think of it 🤔 Let me try ... It worked 😃
10th Oct 2021, 8:43 AM
Agnes Ahlberg
Agnes Ahlberg - avatar