Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ijunior
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Player player01 = new Player("Мария", 20, 2);
- Player player02 = new Player("Роман", 30, 3);
- Player player03 = new Player("Ирина", 40, 4);
- player01.ShowInfo();
- player02.ShowInfo();
- player03.ShowInfo();
- }
- }
- class Player
- {
- private string _name;
- private int _age;
- private int _level;
- public Player(string name, int age, int level)
- {
- _name = name;
- _age = age;
- _level = level;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"Имя: {_name} || Возраст: {_age} || Уровень: {_level}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment