lovelyvook

Unit_05

Mar 30th, 2024
775
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 Ijunior
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int gold;
  14.             int priceOfCrystal = 10;
  15.             int numberOfCrystals;
  16.  
  17.             Console.Write($"Сколько у вас золота? ");
  18.             gold = Convert.ToInt32(Console.ReadLine());
  19.  
  20.             Console.Write($"Сегодня кристаллы стоят {priceOfCrystal} золота. Сколько кристаллов хотите купить? ");
  21.             numberOfCrystals = Convert.ToInt32(Console.ReadLine());
  22.  
  23.             gold -= numberOfCrystals * priceOfCrystal;
  24.  
  25.             Console.WriteLine($"Вы приобрели {numberOfCrystals} кристаллов, у вас осталось {gold} золота");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment