Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save smah-beep/8bab90581ebe1b0fa8a033d30bc53e21 to your computer and use it in GitHub Desktop.

Select an option

Save smah-beep/8bab90581ebe1b0fa8a033d30bc53e21 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 _DZ_
{
internal class Program
{
static void Main(string[] args)
{
int money;
int gems;
int priceGem = 18;
Console.Write("Прежде чем зайти в магазин, укажите сколько у вас золота: ");
money = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Вы зашли в магазин, вам предлагают купить кристаллы");
Console.Write("Укажите какое количество кристаллов вы бы хотели преобрести: ");
gems = Convert.ToInt32(Console.ReadLine());
money -= gems * priceGem;
Console.WriteLine($"Вы преобрели столько кристалов: {gems}, теперь у вас монет: {money}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment