Advertisement
JohnJuly

Homework6

Oct 3rd, 2023 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 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 Homework6
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             float money;
  14.             float countCrystals;
  15.             float priceForCrystal = 10;
  16.  
  17.             Console.Write("В нашем магазине выможете купить кристаллы, сколько у вас золота? ");
  18.             money = Convert.ToSingle(Console.ReadLine());
  19.             Console.Write($"Отлично! Какое количество вы хотите купить? Цена за один - {priceForCrystal} золота! ");
  20.             countCrystals = Convert.ToSingle(Console.ReadLine());
  21.             money -= priceForCrystal*countCrystals;
  22.  
  23.             Console.WriteLine($"У Вас {countCrystals} кристаллов и осталось {money} золота!!!");
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement