This commit is contained in:
2026-10-06 15:52:54 +03:00
parent dac8cdc8ab
commit 9f08efb21b
3 changed files with 87 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
using System;
namespace lab06
{
class Pokemon
{
private string name;
private int level;
private int hp;
public string Name
{
get { return name; }
set { name = value; }
}
public int Level
{
get { return level; }
set { level = value; }
}
public int HP
{
get { return hp; }
set { hp = value; }
}
public Pokemon(string name, int level, int hp)
{
this.name = name;
this.level = level;
this.hp = hp;
}
public void ShowInfo()
{
Console.WriteLine($"Имя: {name}, Уровень: {level}, HP: {hp}");
}
}
class Program
{
static void Main()
{
Pokemon pokemon1 = new Pokemon("Пикачу", 5, 100);
Pokemon pokemon2 = new Pokemon("Сквиртл", 7, 90);
Console.WriteLine("=== ПОКЕДЕКС ===");
pokemon1.ShowInfo();
pokemon2.ShowInfo();
}
}
}
+11
View File
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>lab_06</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+16
View File
@@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-06", "lab-06.csproj", "{E31A458F-ABCE-4E66-92B8-C39ECB503F82}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E31A458F-ABCE-4E66-92B8-C39ECB503F82}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal