Neon1x1st

7hre

Mar 5th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp8
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int gold;
  10.             int crystals;
  11.             int exchangeRates = 30;
  12.             Console.WriteLine("Добрый день!Здесь вы можете купить кристаллы\nСтоимость 1 кристалла 30 золота");
  13.             Console.Write("Сколько у вас золота:");
  14.             gold = Convert.ToInt32(Console.ReadLine());
  15.             Console.Write("Сколько кристаллов вы желаете купить:");
  16.             crystals = Convert.ToInt32(Console.ReadLine());
  17.             gold = gold - crystals * exchangeRates;
  18.             Console.WriteLine("У вас осталось:" + gold + " золота и " + crystals + " кристалла(ов)");
  19.             Console.ReadKey();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment