JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* SOLVED! This is not the final and working code. If you need help, send me a DM
or ask others. */
import java.util.*;
public class HalloweenCandy {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int houses = input.nextInt();
try {
double percentage = 2.0/(houses/100.0);
System.out.println(Math.ceil(percentage));
} catch(Exception e) {
System.out.println(e);
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run