Skip to content

Instantly share code, notes, and snippets.

@MagSosiq
Created May 9, 2024 14:37
Show Gist options
  • Save MagSosiq/131205755e5b1ae0ba9eed0ac00249f0 to your computer and use it in GitHub Desktop.
Save MagSosiq/131205755e5b1ae0ba9eed0ac00249f0 to your computer and use it in GitHub Desktop.
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