Skip to content

Instantly share code, notes, and snippets.

@VladimirYus
Created November 20, 2025 03:58
Show Gist options
  • Select an option

  • Save VladimirYus/42ef50aa7b00df348be4d2559eddf7c8 to your computer and use it in GitHub Desktop.

Select an option

Save VladimirYus/42ef50aa7b00df348be4d2559eddf7c8 to your computer and use it in GitHub Desktop.
CrystalStore
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace CrystalStore
{
internal class Program
{
static void Main(string[] args)
{
int costOfOneCrystal = 10;
int crystals;
int userMoney;
Console.WriteLine("Добро пожаловать в магазин кристаллов!");
Console.WriteLine();
Console.Write($"Сегодня цена одного кристалла {costOfOneCrystal} монет. Сколько у вас монет? ");
userMoney = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Сколько кристаллов вы хотите купить? ");
crystals = Convert.ToInt32(Console.ReadLine());
userMoney -= crystals * costOfOneCrystal;
Console.WriteLine($"У вас в сумке {crystals} кристаллов и {userMoney} монет.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment