Skip to content

Instantly share code, notes, and snippets.

@KaslGame
Last active February 6, 2025 14:35
Show Gist options
  • Save KaslGame/1eed0b94af017059c8536f2b4abe3e31 to your computer and use it in GitHub Desktop.
Save KaslGame/1eed0b94af017059c8536f2b4abe3e31 to your computer and use it in GitHub Desktop.
using System;
namespace Learn
{
class Program
{
static void Main(string[] args)
{
int crystalsCount = 0;
int costCrystal = 10;
Console.Write($"Введите начальное кол-во золота: ");
int goldCount = Convert.ToInt32(Console.ReadLine());
Console.Write($"Количество золота: {goldCount}. Количество Кристалов: {crystalsCount}. Цена 1 кристала - {costCrystal}. Сколько хотите купить кристалов?: ");
int purchasedCrystalCount = Convert.ToInt32(Console.ReadLine());
goldCount -= purchasedCrystalCount * costCrystal;
crystalsCount += purchasedCrystalCount;
Console.Write($"Количество золота: {goldCount}. Количество Кристалов: {crystalsCount}.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment