Created
May 9, 2024 14:37
-
-
Save MagSosiq/131205755e5b1ae0ba9eed0ac00249f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace HW1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.InputEncoding = Encoding.Unicode; | |
Console.OutputEncoding = Encoding.Unicode; | |
Console.Write("Количество золота в нашем кошельке = "); | |
float gold = Convert.ToSingle(Console.ReadLine()); | |
Console.Write("Цена в золоте за 1 кристал: "); | |
float crystalPrice = Convert.ToSingle(Console.ReadLine()); | |
Console.Write($"Укажите количество кристалов, которое хотите купить: (Цена одного кристала {crystalPrice}): "); | |
int nubmerOfCrystals = Convert.ToInt32(Console.ReadLine()); | |
gold -= (nubmerOfCrystals * crystalPrice); | |
Console.WriteLine($"У вас в сумке {nubmerOfCrystals} кристалов и осталось {gold} золота"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment