+ 3
Is there something wrong in paint cost? [SOLVED]
I am trying to solve the paint cost problem in code coach but it always fails 3rd and 5th test. Why?? Whats wrong? Please tell https://code.sololearn.com/cXNq57SaHsV0/?ref=app
3 odpowiedzi
+ 10
Probably because ceil() will return a float type variable. The task asks for a int type variable. Just add an (int) before ceil()
cout << (int)ceil(cost);
Now it's working(tested)
+ 2
molang Thanks, it worked.
Thanks a lot
+ 1
Thank you Molang!
had the same issue