0

Still one test case is wrong..please help me in this...

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); int siblings = input.nextInt(); int popsicles = input.nextInt(); if(siblings%2==0&&popsicles%2==1) { System.out.println("eat them yourself"); } else { System.out.println("give away"); } //your code goes here } }

10th Jan 2022, 5:41 AM
Beginner
Beginner - avatar
4 Respuestas
+ 4
Instead of writing //If(siblings.........==1) Try this if(popsicles%siblings==0)
10th Jan 2022, 6:09 AM
Ananya | Inactive |
Ananya | Inactive | - avatar
+ 2
Try Scanner input = new Scanner(System.in); And yet your question seems to be incomplete. Can we know which question you are talking about.
10th Jan 2022, 5:58 AM
Ananya | Inactive |
Ananya | Inactive | - avatar
0
Sorry I updated it...
10th Jan 2022, 6:02 AM
Beginner
Beginner - avatar
0
It worked for this popsicles%siblings==0 Thannk you ananya
10th Jan 2022, 6:11 AM
Beginner
Beginner - avatar