This commit is contained in:
2026-09-17 10:01:31 +03:00
parent d5f734da5d
commit 1683cf3d92
30 changed files with 35 additions and 0 deletions
@@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{757B23C3-24C2-4C39-B5EF-F50696537305}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{757B23C3-24C2-4C39-B5EF-F50696537305}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{757B23C3-24C2-4C39-B5EF-F50696537305}.Debug|Any CPU.Build.0 = Debug|Any CPU
{757B23C3-24C2-4C39-B5EF-F50696537305}.Release|Any CPU.ActiveCfg = Release|Any CPU
{757B23C3-24C2-4C39-B5EF-F50696537305}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@@ -0,0 +1,62 @@
Console.Write("Введите текущее количество HP покемона: ");
int hp = Convert.ToInt32(Console.ReadLine());
if (hp <= 0)
{
Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
}
else
{
if (hp <= 20)
{
Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
}
else
{
if (hp <= 50)
{
Console.WriteLine("Покемон ранен, будьте осторожны.");
}
else
{
Console.WriteLine("Покемон полон сил и готов к бою!");
}
}
}
// Задание 2.2
Console.WriteLine("Меню команд:");
Console.WriteLine("1 - Атака");
Console.WriteLine("2 - Инвентарь");
Console.WriteLine("3 - Сменить покемона");
Console.WriteLine("4 - Побег");
Console.Write("Выберите действие: ");
int choice = Convert.ToInt32(Console.ReadLine());
if (choice == 1)
{
Console.WriteLine("Покемон наносит быстрый удар!");
}
else
{
if (choice == 2)
{
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
}
else
{
if (choice == 3)
{
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
}
else
{
if (choice == 4)
{
Console.WriteLine("Вы успешно сбежали из боя!");
}
else
{
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
}
}
}
}