Sininerebane

Untitled

May 17th, 2023
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | Cybersecurity | 0 0
  1. namespace CrystalTask
  2. {
  3.     internal class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             int gold;
  8.             int crystals;
  9.             int priceCrystal = 5;
  10.  
  11.             Console.Write("Ввредите начальное количество золота: ");
  12.             gold = Convert.ToInt32(Console.ReadLine());
  13.             Console.WriteLine("Предлагаем вам купить кристалы по цене 5 евро за штуку. Какое количество кристалов вы бы хотели
  14.            купить?");
  15.             crystals = Convert.ToInt32(Console.ReadLine());
  16.  
  17.             gold -= crystals * priceCrystal;
  18.  
  19.             Console.WriteLine("У вас осталось {0} золота и {1} кристалов", gold, crystals);
  20.             Console.ReadKey();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment