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 shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- int price = 5;
- int playerMoney;
- int crystals;
- Console.WriteLine("Вы зашли в магазин, чтобы купить немного кристаллов.");
- Console.WriteLine("Сколько у вас с собой золотых монет?");
- playerMoney = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine($"Кристаллы стоят {price} монет за штуку. Сколько штук вы хотите купить?");
- crystals = Convert.ToInt32(Console.ReadLine());
- playerMoney = playerMoney - crystals * price;
- Console.WriteLine($"Теперь у вас {crystals} кристаллов и {playerMoney} золотых монет.");
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement