Anonim_999

class

Jun 5th, 2021 (edited)
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Player player1 = new Player("Хош Пак", 35,110,90,27);
  10.             player1.ShowStats();
  11.         }
  12.  
  13.         class Player
  14.         {
  15.             public string Name;
  16.             public int Age;
  17.             public int Height;
  18.             public int Weight;
  19.             public int Lvl;
  20.  
  21.             public Player(string name, int age, int height, int weight, int lvl)
  22.             {
  23.                 Name = name;
  24.                 Age = age;
  25.                 Height = height;
  26.                 Weight = weight;
  27.                 Lvl = lvl;
  28.             }
  29.  
  30.             public void ShowStats()
  31.             {
  32.                 Console.WriteLine($"Имя: {Name}\nВозраст: {Age}\nРост: {Height}\nВес: {Weight}\nУровень {Lvl}");
  33.             }
  34.         }
  35.     }
  36. }
  37.  
Add Comment
Please, Sign In to add comment