- 2

Por que me sale error en el caso de prueba 5 en el ejercicio de las emociones

30th May 2021, 1:53 AM
Victor
Victor - avatar
2 ответов
+ 1
Why I get an error in test case 5 in the exercise of emotions please post your code and attempt so that we can help you.
30th May 2021, 3:19 AM
NEZ
NEZ - avatar
0
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int emotion = scanner.nextInt(); /* 1 - "You are happy!" 2 - "You are sad!" 3 - "You are angry!" 4 - "You are surprised!" other - "Unknown emotion." */ // tu código va aquí switch (emotion){ case 1: System.out.println("You are happy!"); break; case 2: System.out.println("You are sad!"); break; case 3: System.out.println("You are angry!"); break; case 4: System.out.println("You are surprised!"); default: System.out.println("Unknown emotion."); } } }
30th May 2021, 11:44 AM
Victor
Victor - avatar