+ 3

Have anyone have a simple logic for "Halloween Candy" in code coach problem??

Only first two testcases passed. All the 3 are hidden. Help someone...

21st Apr 2020, 6:17 PM
Shriaarthy E
Shriaarthy E - avatar
6 odpowiedzi
+ 1
https://code.sololearn.com/cAzRZhyJTO2w/?ref=app Refer my code... #include <stdio.h> #include <math.h> int main() { int houses,c; scanf("%d", &houses); c=200/houses; if(200%houses==0) printf("%d",c); else printf("%d",c+1); return 0; }
21st Apr 2020, 6:22 PM
Regnard Viven
Regnard Viven - avatar
+ 4
RAJESH SAHU thanks. I was trying in c. Got it from regnard.
21st Apr 2020, 6:27 PM
Shriaarthy E
Shriaarthy E - avatar
+ 3
Let's see your code
21st Apr 2020, 6:23 PM
Justus
Justus - avatar
+ 3
Got it from regnard. Thanks Regnard Viven and Justus .
21st Apr 2020, 6:25 PM
Shriaarthy E
Shriaarthy E - avatar
+ 2
In python: import math houses = int(input()) print(math.ceil(2/houses*100))
21st Apr 2020, 6:26 PM
ANJALI SAHU
+ 2
Shriaarthy E okk..☺️
21st Apr 2020, 6:30 PM
ANJALI SAHU