diff --git a/works/cisharp/lab-05/Program.cs b/works/cisharp/lab-05/Program.cs new file mode 100644 index 0000000..9e98689 --- /dev/null +++ b/works/cisharp/lab-05/Program.cs @@ -0,0 +1,64 @@ +namespace ConsoleApp3; +using System; + +class Program +{ + + /* static void Main() { + int pokemonHp = 20; + Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ==="); + Console.WriteLine($"Здоровье до лечения: {pokemonHp} HP"); + Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP."); + HealPokemon(ref pokemonHp); + + + Console.WriteLine($"Здоровье после лечения: {pokemonHp} "); + } + + static void HealPokemon(ref int healPokemon) { + healPokemon += 80; + }*/ + + /*static void Main() + { + SearchBushes(out string foundPokemon,out int pokemonLevel ); + Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ==="); + Console.WriteLine("Вы зашли в высокую траву"); + Console.WriteLine($"Шорох! Из кустов появляется дикий {foundPokemon} (Уровень: {pokemonLevel})!"); + } + + static void SearchBushes(out string foundPokemon,out int pokemonLevel) + { + Random random = new Random(); + pokemonLevel = random.Next(1,25); + foundPokemon = "Пикачу"; + }*/ + + + static void Main() + { + Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ==="); + double difficulty = 1.5; + RegisterTournament(in difficulty, "Булбазавр", "Чармандер"); + Console.WriteLine("-----------------------------"); + RegisterTournament(in difficulty, "Сквиртл", "Пикачу", "Псайдак", "Мяут"); + Console.WriteLine("============================="); + + Console.ReadLine(); + } + + + static void RegisterTournament(in double difficulty, params string[] participants) + { + + Console.WriteLine($"Коэффициент стадиона: {difficulty}"); + Console.WriteLine("Список участников:"); + foreach (string p in participants) + { + Console.WriteLine($" * {p}"); + } + } +} + + +