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);