0
Why my cost fail in paint cost test
#include <iostream> #include<math.h> using namespace std; int main() { int a; float b = 40.00; float c = 5.00; cin>>a; std::cout<<ceilf((b+c*a)/10+b+c*a); return 0; }
2 Antworten
+ 4
I had exactly same problem 😏
Then I just replaced ceil with round (you are using ceilf btw)
and casted value to int before printing to console.
generally it was like :
cout << (int) round(that formula);
That worked 🙄
+ 1
I recommend to use:
float a;
and 10.0 instead 10