0
Im not able to clear 5th test in popsicle test, will you help
siblings = int(input()) popsicle = int(input()) if( siblings > 0 and popsicle > 0 and popsicle > siblings ): if(popsicle % siblings ==0): a = popsicle / siblings print ("give away") else: print("eat them yourself") elif (siblings <= 0 or popsicle <= 0 or popsicle < siblings ): print("eat them yourself")
3 Respostas
+ 3
Just try this
siblings = int(input())
popsicles = int(input())
if popsicles % siblings == 0:
print ("give away")
else :
print ("eat them yourself")
0
Thanks
0
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();
int temp = popsicles%2;
if (siblings <= popsicles ){
if (temp == 0) {
System.out.println("give away");
}
else {
System.out.println("eat them yourself");
}
}
if (siblings > popsicles ){
if (siblings % popsicles == 0) {
System.out.println("give away");
}
else {
System.out.println("eat them yourself");
}
}
}
}