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();
}
}
}