Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace C_Ijun
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int money;
- int crystallCount;
- int crystallPrice;
- bool enoughMoney;
- Console.Write("Введите стоимость кристаллов: ");
- crystallPrice = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Добро пожаловать в магазин кристаллов! Сегодня кристаллы по " + crystallPrice + " монет.");
- Console.Write("Сколько у вас золота: ");
- money = Convert.ToInt32(Console.ReadLine());
- Console.Write("Сколько кристаллов вам нужно: ");
- crystallCount = Convert.ToInt32(Console.ReadLine());
- enoughMoney = money >= crystallCount * crystallPrice;
- crystallCount *= Convert.ToInt32(enoughMoney);
- money -= crystallCount * crystallPrice;
- Console.WriteLine("У вас в сумке - " + crystallCount + " кристаллов и " + money + " монет.");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement