Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ana19997/a0e648cd453eb8217f0070b4e6a10516 to your computer and use it in GitHub Desktop.
Save Ana19997/a0e648cd453eb8217f0070b4e6a10516 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 магазин
{
class Program
{
static void Main(string[] args)
{
int golgToCrystals = 5;
float wallet;
float price;
float crystals;
float gold;
string userInput;
Console.WriteLine("Приветствуем Вас в магазине. Вы можете купить у нас кристаллы.");
Console.WriteLine("Сколько кристаллов Вам требуется:");
crystals = Convert.ToSingle(Console.ReadLine());
Console.WriteLine("Сколько у Вас золота:");
wallet = Convert.ToSingle(Console.ReadLine());
if (wallet >= 5)
{
price = crystals * golgToCrystals;
gold = wallet - price;
}
else
{
Console.WriteLine("Недостаточно золота");
}
Console.WriteLine("У вас " + " золота " + " и " + crystals + " кристаллов ");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment