Обновить works/lab-01/миу миу.txt

This commit is contained in:
zxc
2026-09-08 09:00:23 +00:00
parent 68173ebdfc
commit 8a0564df75
+65
View File
@@ -0,0 +1,65 @@
using System;
class Program
{
static void Main()
{
/* Console.WriteLine("=== Leveling up a Pokemon ===");
// запрос базовой атаки
Console.Write("Enter the Pokemon's base attack value: ");
int Attack = int.Parse(Console.ReadLine());
// запрос количества полученных уровней
Console.Write("Enter the number of levels gained: ");
int level = int.Parse(Console.ReadLine());
// расчёт итоговой атаки
int finalAttack = Attack + (level * 5);
Console.WriteLine($"Pokemon's final attack: {finalAttack}");
// баланс тренера
int balans = 1500;
Console.Write($" trainer's current balance: {balans}");
//стоимость зелья
int potion = 200;
//скок зельев хочешь то емае
Console.Write("How many potions did you buy?: ");
int quantity = int.Parse(Console.ReadLine());
Console.WriteLine($"you bought: {quantity} potion");
//формула пока не один, но тоже сойдет
int by = potion * quantity;
int konec = balans - by;
Console.WriteLine($"You got a good one: {quantity} potion, and there remained {konec} money");
*/
//запрос хэпэ
Console.Write("Enter HP: ");
int hp = int.Parse(Console.ReadLine());
Console.WriteLine($"HP: {hp}");
if (hp <= 0)
{
Console.WriteLine("The Pokemon fainted! Return it to its Poke Ball.");
}
else if (hp >= 1 && hp <= 20)
{
Console.WriteLine("Critical condition! Use a potion immediately!");
}
else if (hp >= 21 && hp <= 50)
{
Console.WriteLine("The Pokemon is injured; be careful.");
}
else
{
Console.WriteLine("The Pokemon is full of energy and ready for battle!");
}
}
}