Created
May 5, 2021 08:10
-
-
Save Ana19997/a0e648cd453eb8217f0070b4e6a10516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace магазин | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int golgToCrystals = 5; | |
float wallet; | |
float price; | |
float crystals; | |
float gold; | |
string userInput; | |
Console.WriteLine("Приветствуем Вас в магазине. Вы можете купить у нас кристаллы."); | |
Console.WriteLine("Сколько кристаллов Вам требуется:"); | |
crystals = Convert.ToSingle(Console.ReadLine()); | |
Console.WriteLine("Сколько у Вас золота:"); | |
wallet = Convert.ToSingle(Console.ReadLine()); | |
if (wallet >= 5) | |
{ | |
price = crystals * golgToCrystals; | |
gold = wallet - price; | |
} | |
else | |
{ | |
Console.WriteLine("Недостаточно золота"); | |
} | |
Console.WriteLine("У вас " + " золота " + " и " + crystals + " кристаллов "); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment