generated from admin/template
Загрузить файлы в «works/lab-02»
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.InputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.WriteLine("=== Прокачка покемона ===");
|
||||
Console.WriteLine("Введите базовую атаку покемона: ");
|
||||
int baseDamage = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine("Введите кол-во полученных уровней: ");
|
||||
int reachedLevels = int.Parse(Console.ReadLine());
|
||||
int finalDamage = baseDamage * (reachedLevels * 5);
|
||||
Console.WriteLine($"Ваш финальный урон: {finalDamage}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.InputEncoding = System.Text.Encoding.UTF8;
|
||||
int balance = 1500;
|
||||
int potionSale = 200;
|
||||
Console.WriteLine("Ваш баланс 1500 монет");
|
||||
Console.WriteLine("Зелье стоит 200 монет");
|
||||
Console.WriteLine("Сколько зелий вы хотите купить?");
|
||||
int potionBuy = int.Parse(Console.ReadLine());
|
||||
int ostatok = 1500 - potionBuy * 200 ;
|
||||
if (ostatok < 0)
|
||||
{
|
||||
Console.WriteLine("У вас не хватает денег! Купите поменьше!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Вы купили {potionBuy} зелий, у вас осталось {ostatok} монет");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.InputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.WriteLine("Вашего покемона атаковали!");
|
||||
Console.WriteLine("Введите сколько у него осталось здоровье! (максимум 50)");
|
||||
int currentHp = int.Parse(Console.ReadLine());
|
||||
if (currentHp <= 0)
|
||||
{
|
||||
Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
|
||||
}
|
||||
if (currentHp > 1 && currentHp < 21)
|
||||
{
|
||||
Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
|
||||
}
|
||||
if (currentHp > 20 && currentHp < 50)
|
||||
{
|
||||
Console.WriteLine("Покемон ранен, будьте осторожны.");
|
||||
}
|
||||
if (currentHp >= 50)
|
||||
{
|
||||
Console.WriteLine("Покемон полон сил и готов к бою!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.InputEncoding = System.Text.Encoding.UTF8;
|
||||
Console.WriteLine("БОЙ НАЧАЛСЯ, ДАЙТЕ ПОКЕМОНУ КОМАНДУ!");
|
||||
Console.WriteLine("1 — Атака");
|
||||
Console.WriteLine("2 — Инвентарь");
|
||||
Console.WriteLine("3 — Сменить покемона");
|
||||
Console.WriteLine("4 — Побег");
|
||||
int command = int.Parse(Console.ReadLine());
|
||||
switch(command)
|
||||
{
|
||||
case 1:
|
||||
Console.WriteLine("Покемон наносит быстрый удар!");
|
||||
break;
|
||||
case 2:
|
||||
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
|
||||
break;
|
||||
case 3:
|
||||
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
|
||||
break;
|
||||
case 4:
|
||||
Console.WriteLine("Вы успешно сбежали из боя!");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user