kwest87

Untitled

Apr 24th, 2022
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. [StartCode]
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp21
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Player player1 = new Player(5,3,1);
  15.             player1.ShowStats();
  16.         }
  17.     }
  18.  
  19.     class Player
  20.     {
  21.         private int _age;
  22.         private int _weight;
  23.         private int _growth;
  24.  
  25.         public Player(int age, int weight, int growth)
  26.         {
  27.             _age = age;
  28.             _weight = weight;
  29.             _growth = growth;
  30.         }
  31.  
  32.         public void ShowStats()
  33.         {
  34.             Console.WriteLine(_age + " лет.\nВес - " + _weight + " килограмма.\nРост - " + _growth + " метр.");
  35.         }
  36.     }
  37. }
  38. [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment