generated from admin/template
puuuush
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
namespace DefaultNamespace;
|
||||
|
||||
public class ex1
|
||||
{
|
||||
static void HealPokemon(ref int pokemonHP)
|
||||
{
|
||||
pokemonHP += 80;
|
||||
Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP.");
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ===");
|
||||
int pokemonHP = 20;
|
||||
Console.WriteLine($"Здоровье до лечения: {pokemonHP} HP.");
|
||||
|
||||
HealPokemon(ref pokemonHP);
|
||||
|
||||
Console.WriteLine($"Здоровье после лечения: {pokemonHP} HP.");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace DefaultNamespace;
|
||||
|
||||
public class ex2
|
||||
{
|
||||
static void SearchBushes(out string foundPokemon, out int pokemonLevel)
|
||||
{
|
||||
foundPokemon = "Пикачу";
|
||||
|
||||
Random random = new Random();
|
||||
pokemonLevel = random.Next(1, 16);
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===");
|
||||
Console.WriteLine("Вы зашли в высокую траву...");
|
||||
|
||||
SearchBushes(out string foundPokemon, out int pokemonLevel);
|
||||
|
||||
Console.WriteLine($"Шорох! Из кустов появляеться дикикй {foundPokemon} (Уровень: {pokemonLevel})");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace DefaultNamespace;
|
||||
|
||||
public class ex3
|
||||
{
|
||||
static void RegisterTourment(in double x, in double difficulty, params string[] participants)
|
||||
{
|
||||
Console.WriteLine($"Коэффициент стадиона: {difficulty}");
|
||||
Console.WriteLine("Список участников:");
|
||||
|
||||
foreach (string pokemon in participants)
|
||||
{
|
||||
Console.WriteLine($" * {pokemon}");
|
||||
}
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ===");
|
||||
double stadiumDifficulty = 1.5;
|
||||
|
||||
// Первый вызов: 2 покемона через params
|
||||
RegisterTournament(in stadiumDifficulty, "Булбазавр", "Чармандер");
|
||||
Console.WriteLine("-----------------------------");
|
||||
|
||||
// Второй вызов: 4 покемона через params
|
||||
RegisterTournament(in stadiumDifficulty, "Сквиртл", "Пикачу", "Псайдак", "Мяут");
|
||||
Console.WriteLine("=============================");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user