From ffbef426f6d6cdc277ae746949e0b79bb581b6d6 Mon Sep 17 00:00:00 2001 From: solomov_b <62+solomov_b@noreply.localhost> Date: Tue, 24 Nov 2026 17:16:49 +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/charp/lab-05/Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/charp/lab-05/Readme.md | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 works/charp/lab-05/Readme.md diff --git a/works/charp/lab-05/Readme.md b/works/charp/lab-05/Readme.md new file mode 100644 index 0000000..bea0bd6 --- /dev/null +++ b/works/charp/lab-05/Readme.md @@ -0,0 +1,43 @@ +Console.WriteLine("=== ЗАДАНИЕ 1. ==="); +int pokemonHp = 20; +Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ==="); +Console.WriteLine($"Здоровье до лечения: {pokemonHp}."); +static void HealPokemon(ref int pokemonHp) +{ + pokemonHp += 80; + Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP."); +} +HealPokemon(ref pokemonHp); +Console.WriteLine($"Здоровье после лечения: {pokemonHp}."); + +Console.WriteLine("\n=== ЗАДАНИЕ 2. ==="); +Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ==="); +Console.WriteLine($"Вы зашли в высокую траву..."); + +static void SearchBushes(out string foundPokemon, out int pokemonLevel) +{ + foundPokemon = "Пикачу"; + pokemonLevel = new Random().Next(1, 15); +} + +SearchBushes(out string pokemonName, out int level); +Console.WriteLine($"Шорох! Из кустов появляется дикий {pokemonName}, (Уровень: {level})"); + +Console.WriteLine("\n=== ЗАДАНИЕ 3. ==="); +static void RegisterTournament(in double difficulty, params string[] participants) +{ + // difficulty = 2.0; // компилятор выдаст ошибку + + Console.WriteLine($"Коэффициент стадиона: {difficulty}"); + Console.WriteLine("Список участников:"); + + foreach (string pokemon in participants) + { + Console.WriteLine($"* {pokemon}"); + } +} +Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ==="); +RegisterTournament(1.5, "Бульбазавр", "Чармандер"); +Console.WriteLine("-----------------------------"); +RegisterTournament(1.5, "Сквиртл", "Пикачу", "Псайдак", "Мяут"); +Console.WriteLine("============================="); \ No newline at end of file