GPbl3YH

CSLight #4

Jan 4th, 2021 (edited)
2,385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSLight
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int availableCoins, crystalsValue;
  14.             int priceForCrystal = 45;
  15.             Console.WriteLine("Введите количество монет: ");
  16.             availableCoins = Convert.ToInt32(Console.ReadLine());
  17.             Console.WriteLine("Сколько кристалов вы хотите купить? (один кристал стоит 45 монет) - ");
  18.             crystalsValue = Convert.ToInt32(Console.ReadLine());
  19.             availableCoins -= (crystalsValue * priceForCrystal);
  20.             Console.WriteLine($"У вас на счету {availableCoins} монет и {crystalsValue} кристалов.");
  21.             Console.ReadKey();
  22.         }
  23.     }
  24. }
  25.  
  26.  
Add Comment
Please, Sign In to add comment