generated from admin/template
olafk
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D959845F-02D5-4C96-9BED-432306BA3585}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D959845F-02D5-4C96-9BED-432306BA3585}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D959845F-02D5-4C96-9BED-432306BA3585}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D959845F-02D5-4C96-9BED-432306BA3585}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D959845F-02D5-4C96-9BED-432306BA3585}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,44 @@
|
||||
namespace ConsoleApp1;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Console.WriteLine("=== Прокачка покемона ===");
|
||||
|
||||
//Console.Write("Введите базовую атаку покемона: ");
|
||||
//int baseAttack = int.Parse(Console.ReadLine());
|
||||
|
||||
//Console.Write("Введите количество полученных уровней: ");
|
||||
//int level = int.Parse(Console.ReadLine());
|
||||
|
||||
//int finalAttack = baseAttack +(level*5);
|
||||
|
||||
//Console.WriteLine($"Итоговая атака: {finalAttack}");
|
||||
|
||||
int balance = 1500;
|
||||
int potionPrice = 200;
|
||||
|
||||
Console.WriteLine($"Текущий баланс: {balance} монет");
|
||||
|
||||
Console.Write("Введите количество зелий: ");
|
||||
int potions = int.Parse(Console.ReadLine());
|
||||
|
||||
int totalCost = potions * potionPrice;
|
||||
|
||||
if (totalCost <= balance)
|
||||
{
|
||||
int remainingBalance = balance - totalCost;
|
||||
|
||||
Console.WriteLine("Покупка успешно совершена! ");
|
||||
Console.WriteLine($"Стоимость покупки: {totalCost} монет");
|
||||
Console.WriteLine($"Остаток на балансе: {remainingBalance} монет");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Недостаточно средств");
|
||||
Console.WriteLine($"Необходимо: {totalCost} монет");
|
||||
Console.WriteLine($"Ваше баланс: {balance} монет");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user