generated from admin/template
Начал lesson2
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "9.0.0",
|
||||||
|
"rollForward": "latestMinor",
|
||||||
|
"allowPrerelease": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lesson2", "lesson2\lesson2.csproj", "{478B1AA0-6B34-4B03-841D-E68F3D9D5EEB}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{478B1AA0-6B34-4B03-841D-E68F3D9D5EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{478B1AA0-6B34-4B03-841D-E68F3D9D5EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{478B1AA0-6B34-4B03-841D-E68F3D9D5EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{478B1AA0-6B34-4B03-841D-E68F3D9D5EEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// See https://aka.ms/new-console-template for more information
|
||||||
|
|
||||||
|
Console.WriteLine("=== Прокачка покемона ===");
|
||||||
|
Console.Write("Введите базовое значение атаки покемона: ");
|
||||||
|
int baseAttack = int.Parse(Console.ReadLine());
|
||||||
|
Console.Write("Введите количество полученных уровней: ");
|
||||||
|
int acceptLevel = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
|
int endAttack = baseAttack + (acceptLevel * 5);
|
||||||
|
|
||||||
|
Console.WriteLine($"Итоговое значение атаки: {endAttack}");
|
||||||
|
|
||||||
|
|
||||||
|
int beginBalance = 1500;
|
||||||
|
int costPotion = 200;
|
||||||
|
Console.WriteLine($"Текущий баланс: {beginBalance}");
|
||||||
|
Console.Write("Введите количество приобретаемых зелий: ");
|
||||||
|
int amountPotions = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
amountPotions = int.Parse(Console.ReadLine());
|
||||||
|
if (amountPotions * costPotion > beginBalance)
|
||||||
|
{
|
||||||
|
Console.Write("Стоимость превышает текущий баланс! Ведите другое значение: ");
|
||||||
|
amountPotions = int.Parse(Console.ReadLine());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (amountPotions * costPotion > beginBalance);
|
||||||
|
|
||||||
|
int endCost = beginBalance - (amountPotions * costPotion);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine($"Успешная покупка! Баланс: {endCost}");
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user