From 38cc2263b45dd0232077ae7d47e9c6fc9f9a4b28 Mon Sep 17 00:00:00 2001 From: "kosios.obsi" Date: Wed, 9 Sep 2026 10:22:36 +0300 Subject: [PATCH] lab-03 --- works/Csharp/lab-03/lab-03/Program.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/works/Csharp/lab-03/lab-03/Program.cs b/works/Csharp/lab-03/lab-03/Program.cs index 64557f5..e220570 100644 --- a/works/Csharp/lab-03/lab-03/Program.cs +++ b/works/Csharp/lab-03/lab-03/Program.cs @@ -19,15 +19,26 @@ Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Atta */ // task 2 + +using System.ComponentModel.Design; + int choice; Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): "); do { choice = int.Parse(Console.ReadLine()); - Console.WriteLine("Некорректная команда! Попробуйте снова."); -} while (choice != 1 && choice != 0); -{ - Console.WriteLine("Некорректная команда! Попробуйте снова."); -} + if (choice == 1) + { + Console.WriteLine("Вы начали бой!"); + } + else if (choice == 0) + { + Console.WriteLine("Вы отменили бой!"); + } + else + { + Console.WriteLine("Некорректная команда! Попробуйте снова."); + } +} while (choice != 1 && choice != 0);