Добавлены весь файлы и папки

This commit is contained in:
=
2026-10-02 02:11:08 +03:00
parent 9c1453eda6
commit ee942fe4ae
31 changed files with 231 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+82
View File
@@ -0,0 +1,82 @@
# ЛАБОРАТОРНАЯ РАБОТА №5
## Задание №1
```
static void Main(string[] args)
{
int pokemonHp = 20;
Console.WriteLine($@"=== ПОКЕЦЕНТР ЛЕЧЕНИЕ ===
Здоровье до лечения: {pokemonHp} HP.");
HealPokemon(ref pokemonHp);
Console.WriteLine($"Здоровье после лечения: {pokemonHp} HP.");
}
static void HealPokemon (ref int hp)
{
int restored = 100 - hp;
hp = 100;
Console.WriteLine($"[Покецентр] Покемон полностью здоров! Восстановлено {restored} HP;");
}
```
###### ВЫВОД:
![alt text](image.png)
## Задание №2
```
static void Main(string[] args)
{
Console.WriteLine($@"=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===
Вы зашли в высокую траву...");
string pokemonname;
int level;
SearchBushes(out pokemonname, out level);
Console.WriteLine($"Шорох! Их кустов появляется дикий {pokemonname} (Уровень: {level})!");
}
static void SearchBushes(out string foundPokemon, out int pokemonLevel)
{
Random random = new Random();
pokemonLevel = random.Next(1, 16); //рандом от 1 до 15
foundPokemon = "Пикачу";
}
```
###### ВЫВОД:
![alt text](image-1.png)
## Задание №3
```
static void Main(string[] args)
{
Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ===");
RegisterTournament(1.5, "Булбазавр", "Чармандер"); //вызываем метод, далее нужно заполнить ячейки
Console.WriteLine("-----------------------------");
RegisterTournament(1.5, "Сквиртл", "Пикачу", "Псайдак", "Мяут");
Console.WriteLine("=============================");
}
static void RegisterTournament(in double difficulty, params string[] participants)
{
Console.WriteLine($"Кэф стадиона: {difficulty}");
Console.WriteLine("Список участников: ");
foreach (string pokemon in participants) //Цикл не завершится, пока пользователь введет определенные ячейки
{
Console.WriteLine($" * {pokemon}");
}
}
```
###### ВЫВОД:
![alt text](image-2.png)