Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int gold;
- int crystals;
- int crystalPrice = 12;
- bool exchange;
- Console.WriteLine("Добро пожаловать в банк, с этого дня, вы можете получить кристаллы за 12 золота.");
- Console.Write("Скажите сколько у вас золота?:");
- gold = Convert.ToInt32(Console.ReadLine());
- Console.Write("Сколько вам нужно кристаллов?:");
- crystals = Convert.ToInt32(Console.ReadLine());
- exchange = gold >= crystals * crystalPrice;
- crystals *= Convert.ToInt32(exchange);
- gold -= crystals * crystalPrice;
- Console.WriteLine($"У вас на счету {gold} золота и {crystals} кристаллов.");
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement