Advertisement
TwinFrame

Clight_06_CrystalsShop

Mar 10th, 2023 (edited)
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Clight_06
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int diamondPrice = 30;
  10.  
  11.             Console.Write("Введите количество Вашего золота: ");
  12.             int amountGold = Convert.ToInt32(Console.ReadLine());
  13.  
  14.             Console.Write($"Введите количество кристаллов, которые хотите купить, по {diamondPrice} за штуку: ");
  15.             int amountDiamonds = Convert.ToInt32(Console.ReadLine());
  16.  
  17.             amountGold = amountGold - (amountDiamonds * diamondPrice);
  18.             Console.WriteLine($"В итоге у Вас {amountDiamonds} кристалла и осталось {amountGold} золота.");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement