+ 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; }
3 RĂ©ponses
0
If you could tell me how my code
Gonna work I would be very thankful to you
- 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;
}
- 1
Here my code
It will work.