From 26dca4f3e0deabe5bfa43b5e4d9bd98431031d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=82=D0=B8=D0=BE=20=D0=92=D1=8F=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B0=D0=B2?= Date: Tue, 6 Oct 2026 15:54:52 +0300 Subject: [PATCH] puuush --- works/lab-06/src/ex1.cs | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 works/lab-06/src/ex1.cs diff --git a/works/lab-06/src/ex1.cs b/works/lab-06/src/ex1.cs new file mode 100644 index 0000000..c80bd3a --- /dev/null +++ b/works/lab-06/src/ex1.cs @@ -0,0 +1,52 @@ +namespace DefaultNamespace; + +public class ex1 +{ + static void Main(string[] args) + { + Pokemon pikachu = new Pokemon("Пикачу", 5, 100); + Pokemon sqr = new Pokemon("Сквиртл", 7, 90); + + pikachu.ShowInfo(); + sqr.ShowInfo(); + } +} + +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($"Имя: {this.Name}, Уровень: {this.Level}, HP: {this.Hp}"); + } + + +} \ No newline at end of file