0
Halloween candy...Why it doesn't work???
#include <iostream> #include <cmath> using namespace std; int main() { int houses; cin>>houses; double c = 200/houses; cout<< ceil( c); return 0; } I used ceil () function to round up. but it passes just 1 test...what is the problem??
2 Antworten
+ 3
You have to cast 200 / houses to double before you assign it because you are dividing an int by another int. Try 200.0 / houses or (double)200 / houses.
0
Thank u 🌹🌹😊