0
Code coach popsicle problem (Java)
My code gets 4/5 of the problems right but I don't understand whats wrong with the 5th variation of the problem since I can't see ithers my code : import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); double siblings = input.nextInt(); double popsicles = input.nextInt(); double amount = 1.0; //your code goes here if (siblings > 0) { amount = popsicles/siblings; } if (amount % 2 == 0){ System.out.println("give away");} else { System.out.println("eat them yourself"); } } }
1 ответ