0
wired result? (paint costs / code coach)
I was solving this easy problem (https://www.sololearn.com/coach/22?ref=app ), in the end, this was the result, three were true and two hidden were wrong why these two hidden wrong??, Can anyone help and explain to me that?. I have published the code and result as screenshots in my activity, please see them, thanks!.
5 Réponses
+ 2
You need to change the datatype of your input variable to avoid losing decimals.
Also, output should be rounded.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float n;
cin>>n;
cout<<int(round(40.0+n*5.0+(40.0+n*5.0)/10.0));
return 0;
}
+ 1
According to the task description, we're to ***round up*** the result.
+ 1
Solved! Thank you Simba for your help (knowing that I'm still surprised it didn't accept my previous work)
0
I already understood the describtion, I don't think there's a mistake, or lack of work...
0
round up == ceil/ ceiling
1.1 --> 2