+ 1

Why am I failing (Paint costs)

#include <iostream> #include <cmath> using namespace std; int main() { int colors; cin >> colors; double cost = 40 + (5*colors); cost += cost/10; cout << ceil(cost); return 0; } 5th test won't work

21st Jul 2023, 3:44 PM
Farah Alkayyem
Farah Alkayyem - avatar
1 Answer
+ 6
cout << (int) round(cost);
21st Jul 2023, 3:51 PM
A͢J
A͢J - avatar