SHARE
TWEET

CSharpTask

trmaxa2820 Feb 14th, 2020 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSharpLightTask
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Player player = new Player(20, 10, 45);
  14.             player.ShowStats();
  15.         }
  16.         class Player
  17.         {
  18.             public int Health;
  19.             public int Agility;
  20.             public int Power;
  21.             public int Damage;
  22.  
  23.             public Player(int agility, int power, int damage)
  24.             {
  25.                 Health = 100;
  26.                 Agility = agility;
  27.                 Power = power;
  28.                 Damage = damage;
  29.             }
  30.  
  31.             public void ShowStats()
  32.             {
  33.                 Console.WriteLine("Здоровье персонажа - " + Health + "\nЛовкость персонажа - " + Agility +
  34.                     "\nСила персонажа - " + Power + "\nУрон персонажа - " + Damage);
  35.             }
  36.         }
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top