From 8b925936ff345cef17d68250177b63b8bbed720f Mon Sep 17 00:00:00 2001 From: Rulet13 Date: Wed, 30 Sep 2026 12:19:44 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?works=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/Program.cs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 works/Program.cs diff --git a/works/Program.cs b/works/Program.cs new file mode 100644 index 0000000..1526220 --- /dev/null +++ b/works/Program.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace lab_4 +{ + 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(); + } + } +}