diff --git a/Charp/lab-02/readme.md b/Charp/lab-02/readme.md index d4cdb04..5debe4e 100644 --- a/Charp/lab-02/readme.md +++ b/Charp/lab-02/readme.md @@ -14,6 +14,9 @@ int levels = int.Parse(Console.ReadLine()); int finalAttack = baseAttack + (levels * 5); Console.WriteLine($"Итоговая атака: {finalAttack}"); +``` +### Задание 1.2 +```csharp // ex 1.2 int balance = 1500; const int potionPrice = 200; @@ -28,6 +31,10 @@ int remainingBalance = balance - totalPrice; Console.WriteLine($"\nСтоимость покупки: {totalPrice} монет"); Console.WriteLine($"Покупка успешно совершена! Остаток средств: {remainingBalance} монет"); +``` + +### Задание 2.1 +```csharp // ex 2.1 Console.Write("Введите текущее количество HP покемона: "); int hp = int.Parse(Console.ReadLine()); @@ -48,6 +55,9 @@ else { Console.WriteLine("Покемон полон сил и готов к бою!"); } +``` +### Задание 2.2 +```csharp // ex 2.2 Console.WriteLine("Выберите действие:"); Console.WriteLine("1 — Атака"); @@ -77,4 +87,5 @@ switch (choice) default: Console.WriteLine("Неизвестная команда! Вы пропустили ход."); break; -} \ No newline at end of file +} +``` \ No newline at end of file