From 3fbf17c92d8ffa9ffdab1ccb2b38a257b1bea70b Mon Sep 17 00:00:00 2001 From: Rulet13 Date: Wed, 30 Sep 2026 12:20:56 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20works/lab-04/readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/lab-04/readme.md | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 works/lab-04/readme.md diff --git a/works/lab-04/readme.md b/works/lab-04/readme.md new file mode 100644 index 0000000..dd06966 --- /dev/null +++ b/works/lab-04/readme.md @@ -0,0 +1,47 @@ + internal class Program + { + static void Main(string[] args) + { + //те самые массивы + printZnum(1); + string[] activeTeam = new string[3]; + Console.WriteLine("=== Регистрация команды ==="); + for (int i = 0; i < activeTeam.Length; i++) + { + Console.Write($"Введите имя покемона №{i + 1}: "); + activeTeam[i] = Console.ReadLine(); + } + + Console.WriteLine("\n=== Ваша команда на этот бой ==="); + Console.WriteLine($"1. {activeTeam[0]}"); + Console.WriteLine($"2. {activeTeam[1]}"); + Console.WriteLine($"3. {activeTeam[2]}"); + + //те самые листы + printZnum(2); + Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ==="); + List inventory = new List(); + inventory.Add("Покебол"); + inventory.Add("Зелье"); + inventory.Add("Яблоко"); + Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {inventory.Count}"); + inventory.RemoveAt(0); + Console.WriteLine($"Вы использовали один Покебол для поимки дикого покемона!"); + Console.WriteLine($"Обновленный инвентарь.Осталось предметов: {inventory.Count}"); + + //тот самый foreach + printZnum(3); + Console.WriteLine("=== Содержимое вашей сумки ==="); + foreach (string item in inventory) + { + Console.WriteLine($"[Предмет] -> {item}"); + } + + } + static void printZnum(int num) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"\n----- задание {num} -----"); + Console.ResetColor(); + } + } \ No newline at end of file