Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int playersGold = 100; //золото игрока изначально
- int playersCrystals = 0; //кристалы игрока изначально
- int crystalsForOneGold = 20; //Цена одного золота в кристалах
- string firstOffer; //Приветствие, цена
- string playersGoldInStart; //У вас есть столькото золота
- string howMatchWantToBuy = "Введите количество золота для покупки кристалов(число):";
- string playerNowHave; //конечная фраза
- string countToBuy; //сколько купить
- int intCountToBuy;
- firstOffer = "Здравствуйте, сегодня за единицу золота даем " + crystalsForOneGold + " кристалов.";
- playersGoldInStart = "У вас есть: " + playersCrystals + " кристалов и " + playersGold + " золота.";
- Console.WriteLine(firstOffer);
- Console.WriteLine(playersGoldInStart);
- Console.Write(howMatchWantToBuy);
- countToBuy = Console.ReadLine();
- intCountToBuy = Convert.ToInt32(countToBuy);
- playersGold -= intCountToBuy;
- playersCrystals += crystalsForOneGold * intCountToBuy;
- playerNowHave = "Спасибо за покупку! " + "Теперь у вас есть " + intCountToBuy * crystalsForOneGold + " кристаллов и " + playersGold + " золота.";
- Console.WriteLine(playerNowHave);
- }
- }
- }
Add Comment
Please, Sign In to add comment