Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int gold;
- int price;
- int crystal;
- bool enoughgold;
- Console.Write("Введите кол-во золота: ");
- gold = Convert.ToInt32(Console.ReadLine());
- price = 10;
- Console.WriteLine("Цена кристаллов - " + price + " зол" + " за шт");
- Console.Write("Введите кол-во кристаллов для покупки: ");
- crystal = Convert.ToInt32(Console.ReadLine());
- enoughgold = gold >= price * crystal;
- crystal *= Convert.ToInt32(enoughgold);
- gold -= price * crystal;
- Console.WriteLine("У вас осталось золота - " + gold);
- Console.WriteLine("Куплено кристаллов - " + crystal);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement