0

Тест не пропускает с виду верный код

Это задача про эмоции робота Для изучения switch и case Вот я списал с правильного ответа этот код, но он не проходит import java.util.Scanner; 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." */ switch(emotion){ case 1: System.out.print("You are happy!"); break; case 2: System.out.print("You are sad!"); break; case 3: System.out.print("You are angry!"); break; case 4: System.out.print("You are surprised!"); default: System.out.print("Unknown emotion."); } } }

20th Aug 2022, 7:15 AM
T Akvinski
T Akvinski - avatar
6 Réponses
+ 2
T Akvinski break is missing in case 4
20th Aug 2022, 10:29 AM
A͢J
A͢J - avatar
+ 2
T Akvinski Check ! after surprised
20th Aug 2022, 7:29 AM
A͢J
A͢J - avatar
+ 1
Big thanks brother!!!
20th Aug 2022, 10:50 AM
T Akvinski
T Akvinski - avatar
0
Oh my God! Very thanks for you!
20th Aug 2022, 7:32 AM
T Akvinski
T Akvinski - avatar
0
You the best man
20th Aug 2022, 7:33 AM
T Akvinski
T Akvinski - avatar
0
But ever now going error
20th Aug 2022, 7:37 AM
T Akvinski
T Akvinski - avatar