Skip to content

Instantly share code, notes, and snippets.

@Arseniy-1
Last active April 25, 2024 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arseniy-1/5f93d45759a9585761d3eac72cacf7c8 to your computer and use it in GitHub Desktop.
Save Arseniy-1/5f93d45759a9585761d3eac72cacf7c8 to your computer and use it in GitHub Desktop.
using System;
namespace NewProject
{
internal class Program
{
static void Main(string[] args)
{
int coins;
int crystalsCount;
int crystalsPrice;
Console.Write("Сколько у вас золота? ");
coins = Convert.ToInt32(Console.ReadLine());
Console.Write("Сколько стоит 1 кристал? ");
crystalsPrice = Convert.ToInt32(Console.ReadLine());
Console.Write("Сколько кристалов хотите купить? ");
crystalsCount = Convert.ToInt32(Console.ReadLine());
coins -= (crystalsCount * crystalsPrice);
Console.WriteLine($"У вас {coins} золота и {crystalsCount} кристалов");
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment