+ 1
This code ran without errors, giving me an expected output. But it hasn't been passing sololearn popsicle challenge test cases.
6 Respuestas
+ 3
don't print extra message, just what they ask you to print:
enc=input()
dec=""
for message in enc[::-1]:
if message.isalpha() or message==" ":
dec+=message
print(dec)
+ 3
Mirielle I did
It was actually the "The Spy Life Challenge" I'm trying to solve for
+ 3
John Robotane Thanks. I'll try your suggestion and get back to you.
+ 2
John Robotane Perfect!
Your suggestion works really fine
Thanks man!
+ 2
thank you too... you can update the question (replace Popsicle by The Spy Life)
+ 1
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");
}
}
}
}