Skip to content

Instantly share code, notes, and snippets.

@tsk-arh
Last active January 5, 2024 08:18
Show Gist options
  • Save tsk-arh/831e7d5f9efffb8ee82ebec02ca32b32 to your computer and use it in GitHub Desktop.
Save tsk-arh/831e7d5f9efffb8ee82ebec02ca32b32 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 junior1
{
internal class Program
{
static void Main(string[] args)
{
int playerGold;
int playerCrystals = 0;
int crystalPrice = 10;
int playerCryslalsChoise;
Console.WriteLine($"Сколько у вас золота?");
playerGold = Convert.ToInt32(Console.ReadLine());
Console.WriteLine($"Сколько кристаллов вы желаете приобрести? Сегодня по скидке они стоят всего {crystalPrice}.");
playerCryslalsChoise = Convert.ToInt32(Console.ReadLine());
playerGold -= crystalPrice * playerCryslalsChoise;
playerCrystals = playerCryslalsChoise + playerCrystals;
Console.WriteLine($"У вас теперь {playerGold} золота и {playerCrystals} кристалов");
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment