Created
May 24, 2026 16:02
-
-
Save smah-beep/8bab90581ebe1b0fa8a033d30bc53e21 to your computer and use it in GitHub Desktop.
ДЗ: Магазин кристаллов
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.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