+ 2

Halloween candy not going after 4 test cases

#include <stdio.h> int main() { int houses; scanf("%d", &houses); //your code goes here int p = 100/houses; int z = 100%houses; int c = p*2; if(houses > 3 && z == 0) { printf ("%d",c); } else { printf ("%d",c+1); } return 0; }

17th Feb 2021, 11:47 AM
Vishal
Vishal - avatar
3 Answers
0
If you could tell me how my code Gonna work I would be very thankful to you
19th Feb 2021, 3:58 AM
Vishal
Vishal - avatar
- 1
#include <stdio.h> #include <math.h> int main() { int houses; scanf("%i", &houses); if(houses>=3){ printf("%i",(int)ceil(200.0/houses)); } return 0; }
19th Feb 2021, 1:32 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
- 1
Here my code It will work.
19th Feb 2021, 1:32 AM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar