generated from admin/template
Загрузить файлы в «works»
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace lab_4
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//те самые массивы
|
||||
printZnum(1);
|
||||
string[] activeTeam = new string[3];
|
||||
Console.WriteLine("=== Регистрация команды ===");
|
||||
for (int i = 0; i < activeTeam.Length; i++)
|
||||
{
|
||||
Console.Write($"Введите имя покемона №{i + 1}: ");
|
||||
activeTeam[i] = Console.ReadLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("\n=== Ваша команда на этот бой ===");
|
||||
Console.WriteLine($"1. {activeTeam[0]}");
|
||||
Console.WriteLine($"2. {activeTeam[1]}");
|
||||
Console.WriteLine($"3. {activeTeam[2]}");
|
||||
|
||||
//те самые листы
|
||||
printZnum(2);
|
||||
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||
List<string> inventory = new List<string>();
|
||||
inventory.Add("Покебол");
|
||||
inventory.Add("Зелье");
|
||||
inventory.Add("Яблоко");
|
||||
Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {inventory.Count}");
|
||||
inventory.RemoveAt(0);
|
||||
Console.WriteLine($"Вы использовали один Покебол для поимки дикого покемона!");
|
||||
Console.WriteLine($"Обновленный инвентарь.Осталось предметов: {inventory.Count}");
|
||||
|
||||
//тот самый foreach
|
||||
printZnum(3);
|
||||
Console.WriteLine("=== Содержимое вашей сумки ===");
|
||||
foreach (string item in inventory)
|
||||
{
|
||||
Console.WriteLine($"[Предмет] -> {item}");
|
||||
}
|
||||
|
||||
}
|
||||
static void printZnum(int num)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"\n----- задание {num} -----");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user