0

This code is for task Paint Costs. Test 3 crashes. Does anybody know why? I can't see input for Test 3.

#include <iostream> #include <cmath> using namespace std; int main() { int numOfColors,round_sum,floor_sum; double sum; cin>>numOfColors; sum=1.10*(40.00+5.00*double(numOfColors)); round_sum=round(sum); floor_sum=floor(sum); if ((round_sum-floor_sum)==1 && round_sum%2==1) { cout<<floor_sum; } else { cout<<round_sum; } return 0; }

21st Feb 2020, 11:07 AM
Janko Jankovic
3 Respostas
21st Feb 2020, 11:42 AM
Mihai Apostol
Mihai Apostol - avatar
+ 1
cout<<"Tnx, it helps";
21st Feb 2020, 12:11 PM
Janko Jankovic
0
Janko Jankovic You're welcome.
21st Feb 2020, 12:19 PM
Mihai Apostol
Mihai Apostol - avatar