fix lab-02 csharp
This commit is contained in:
@@ -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 — Атака");
|
||||
@@ -78,3 +88,4 @@ switch (choice)
|
||||
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
|
||||
break;
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user