0
Why can't pass 3,4,5 tests? Halloween candy
#include <iostream> #include <cmath> using namespace std; int main() { int houses; cin>>houses; cout << round(2.0/houses*100); return 0; }
5 Answers
+ 3
DenseAcid python tests also fails for the code you have written . Questions asks to "round up" not just round . round will round a number say 5.2 to 5 while round up will make it 6 .
For rounding up there must be a ceil function in c++
Edit: you can add a tag "code coach" so it makes it easier for others to figure out the source of question or just link the question if possible!
+ 1
DenseAcid
Use ceil instead of round.
0
Please provid more information
0
The same python code passed, but c++ have some problems i think?
0
Which information do u need?