AlexRaynor

1.7

Aug 20th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             int MyGold;
  6.             int NeededCrystals;
  7.             int BuyCrystals;
  8.             int LeftGold;
  9.  
  10.             Console.WriteLine("Приветствую, путник. ");
  11.             Console.WriteLine("Сколько у вас злотых?");
  12.             MyGold = int.Parse(Console.ReadLine());
  13.             if (MyGold < 10)
  14.             {
  15.                 Console.WriteLine("Ты нищ и грязен, ступай отсюда");
  16.             }
  17.             else
  18.             {
  19.                 Console.WriteLine("За один кристалл я хочу 10 злотых. Сколько штук месье желает купить?");
  20.                 NeededCrystals = int.Parse(Console.ReadLine());
  21.                 if (MyGold < NeededCrystals * 10)
  22.                 {
  23.                     Console.WriteLine("Ты шо, считать не умеешь? Пшол вон!");
  24.                 }
  25.                 else
  26.                 {
  27.                     BuyCrystals = NeededCrystals;
  28.                     LeftGold = MyGold - BuyCrystals * 10;
  29.                     Console.WriteLine("Удачная сделка!");
  30.                     Console.WriteLine("Теперь у вас " + BuyCrystals + " кристаллов и " + LeftGold + " золота");
  31.  
  32.                 }
  33.             }
  34.  
  35.  
  36.         }
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment