Created
November 20, 2025 03:58
-
-
Save VladimirYus/42ef50aa7b00df348be4d2559eddf7c8 to your computer and use it in GitHub Desktop.
CrystalStore
This file contains hidden or 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.Security.Policy; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace CrystalStore | |
| { | |
| internal class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| int costOfOneCrystal = 10; | |
| int crystals; | |
| int userMoney; | |
| Console.WriteLine("Добро пожаловать в магазин кристаллов!"); | |
| Console.WriteLine(); | |
| Console.Write($"Сегодня цена одного кристалла {costOfOneCrystal} монет. Сколько у вас монет? "); | |
| userMoney = Convert.ToInt32(Console.ReadLine()); | |
| Console.WriteLine(); | |
| Console.Write("Сколько кристаллов вы хотите купить? "); | |
| crystals = Convert.ToInt32(Console.ReadLine()); | |
| userMoney -= crystals * costOfOneCrystal; | |
| Console.WriteLine($"У вас в сумке {crystals} кристаллов и {userMoney} монет."); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment