Advertisement
loleckek228

5.1

Sep 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _5._1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Hero hero = new Hero("Fergos", "Archer", 27, 42, 68, 37);
  10.             hero.GetInformation();
  11.         }
  12.     }
  13.  
  14.     class Hero
  15.     {
  16.         string name;
  17.         string type;
  18.         int level;
  19.         int strength;
  20.         int agility;
  21.         int intelligence;
  22.  
  23.         public Hero (string name, string type, int level, int strength, int agility, int intelligence)
  24.         {
  25.             this.name = name;
  26.             this.type = type;
  27.             this.level = level;
  28.             this.strength = strength;
  29.             this.agility = agility;
  30.             this.intelligence = intelligence;
  31.         }
  32.  
  33.         public void GetInformation()
  34.         {
  35.             Console.WriteLine("Имя персонажа - " + name + "\nКласс героя - " + type
  36.                 + "\nУровень персонажа - " + level + "\nСила - " + strength +
  37.                 "\nЛовкость - " + agility + "\nИнтеллект - " + intelligence);                
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement