0

# 4/5 test causes failed i don't no why he doesn't work

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); //your code goes here int houses = input.nextInt(); int result ; result = 100/(houses/2) ; System.out.println(result);

5 Answers

+ 2

This may help you...
https://www.sololearn.com/Discuss/2253396/?ref=app

+ 2

Abduosh Language doesn't matter when logic is same.
Check problem again. There is a condition houses >= 3. So you should check this condition like
if (houses >= 3) {
result = 200 / houses.
}
There is one more condition output should be nearest whole number so
result= Math.ceil(result);
Math.round(result);

0

I am using java not c++

0

Scanner input = new Scanner(System.in);
double houses = input.nextDouble();
double chance = (2/houses)*100;
System.out.println((int)Math.ceil(chance));
}

0

I Solved the problems thanks