+ 2
Paint costs test case failed
Code coach problem " paint costs " Why my code fails in Test case 3, test case 4 #include <iostream> using namespace std; int main() { int a; int r ; cin>> a; r = (((a*5)+40) + ((a/2)+4)); if(a<1){ cout<<"44"; } else{ cout <<""<<r; } return 0;
5 ответов
+ 2
You forget to roundup final value and you also missed one curly bracket after return statement.
+ 2
🗡️Jasprit ???🙄
+ 1
Snehal what happened...?
+ 1
🗡️Jasprit test case 3 and test case 4 showing error
0
Total cost is a*5+40 but find the tax for this and add to total then round up* results, use ceil function.
Adding a/2 + 4 may work for single case but it should work for all cases...