Im not able to clear 5th test in popsicle test, will you help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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")

12th Apr 2020, 2:02 PM
Mayank
3 Answers
+ 3
Just try this siblings = int(input()) popsicles = int(input()) if popsicles % siblings == 0: print ("give away") else : print ("eat them yourself")
12th Apr 2020, 2:13 PM
Ayush Kumar
Ayush Kumar - avatar
0
Thanks
12th Apr 2020, 2:16 PM
Mayank
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"); } } } }
24th Apr 2020, 3:14 PM
Mohan .R.A
Mohan .R.A - avatar