Last active
January 5, 2024 08:18
-
-
Save tsk-arh/831e7d5f9efffb8ee82ebec02ca32b32 to your computer and use it in GitHub Desktop.
ЗАДАНИЕ Магазин кристаллов
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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