Last active
February 6, 2025 14:35
-
-
Save KaslGame/1eed0b94af017059c8536f2b4abe3e31 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; | |
namespace Learn | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int crystalsCount = 0; | |
int costCrystal = 10; | |
Console.Write($"Введите начальное кол-во золота: "); | |
int goldCount = Convert.ToInt32(Console.ReadLine()); | |
Console.Write($"Количество золота: {goldCount}. Количество Кристалов: {crystalsCount}. Цена 1 кристала - {costCrystal}. Сколько хотите купить кристалов?: "); | |
int purchasedCrystalCount = Convert.ToInt32(Console.ReadLine()); | |
goldCount -= purchasedCrystalCount * costCrystal; | |
crystalsCount += purchasedCrystalCount; | |
Console.Write($"Количество золота: {goldCount}. Количество Кристалов: {crystalsCount}."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment