Лаба 04
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\prog-radzh\\works\\Csharp\\lab-04\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{073D152A-0F08-4E68-927B-62FDC78E7819}|lab-04\\lab-04.csproj|c:\\prog-radzh\\works\\csharp\\lab-04\\lab-04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{073D152A-0F08-4E68-927B-62FDC78E7819}|lab-04\\lab-04.csproj|solutionrelative:lab-04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Program.cs",
|
||||
"DocumentMoniker": "C:\\prog-radzh\\works\\Csharp\\lab-04\\lab-04\\Program.cs",
|
||||
"RelativeDocumentMoniker": "lab-04\\Program.cs",
|
||||
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-04\\lab-04\\Program.cs",
|
||||
"RelativeToolTip": "lab-04\\Program.cs",
|
||||
"ViewState": "AgIAACUAAAAAAAAAAAAQwCwAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-09-22T17:40:05.962Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\prog-radzh\\works\\Csharp\\lab-04\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{073D152A-0F08-4E68-927B-62FDC78E7819}|lab-04\\lab-04.csproj|c:\\prog-radzh\\works\\csharp\\lab-04\\lab-04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{073D152A-0F08-4E68-927B-62FDC78E7819}|lab-04\\lab-04.csproj|solutionrelative:lab-04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Program.cs",
|
||||
"DocumentMoniker": "C:\\prog-radzh\\works\\Csharp\\lab-04\\lab-04\\Program.cs",
|
||||
"RelativeDocumentMoniker": "lab-04\\Program.cs",
|
||||
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-04\\lab-04\\Program.cs",
|
||||
"RelativeToolTip": "lab-04\\Program.cs",
|
||||
"ViewState": "AgIAACUAAAAAAAAAAAAQwCwAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-09-22T17:40:05.962Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
## task 1
|
||||
```csharp
|
||||
Console.WriteLine("=== РЕГИСТРАЦИЯ КОМАНДЫ ===");
|
||||
|
||||
string[] activeTeam = new string[3];
|
||||
|
||||
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]}");
|
||||
|
||||
Console.WriteLine();
|
||||
```
|
||||
|
||||
## task 2
|
||||
```csharp
|
||||
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||
|
||||
List<string> backpack = new List<string>();
|
||||
|
||||
backpack.Add("Зелье HP");
|
||||
backpack.Add("Покебол");
|
||||
backpack.Add("Антидот");
|
||||
|
||||
Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {backpack.Count}");
|
||||
|
||||
backpack.Remove("Покебол");
|
||||
Console.WriteLine("Вы использовали один Покебол для поимки дикого покемона!");
|
||||
|
||||
Console.WriteLine($"Обновленный инвентарь. Осталось предметов: {backpack.Count}");
|
||||
```
|
||||
|
||||
## task 3
|
||||
```csharp
|
||||
Console.WriteLine("\n--- Содержимое вашей сумки ---");
|
||||
foreach (string item in backpack)
|
||||
{
|
||||
Console.WriteLine($"[Предмет] -> {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("=============================");
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.37628.2 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-04", "lab-04\lab-04.csproj", "{073D152A-0F08-4E68-927B-62FDC78E7819}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{073D152A-0F08-4E68-927B-62FDC78E7819}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{073D152A-0F08-4E68-927B-62FDC78E7819}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{073D152A-0F08-4E68-927B-62FDC78E7819}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{073D152A-0F08-4E68-927B-62FDC78E7819}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {272D78C9-5596-4B06-8EF3-3AE83481A54A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PokemonTrainerLab
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// task 1
|
||||
Console.WriteLine("=== РЕГИСТРАЦИЯ КОМАНДЫ ===");
|
||||
|
||||
string[] activeTeam = new string[3];
|
||||
|
||||
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]}");
|
||||
|
||||
Console.WriteLine();
|
||||
|
||||
// task 2
|
||||
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||
|
||||
List<string> backpack = new List<string>();
|
||||
|
||||
backpack.Add("Зелье HP");
|
||||
backpack.Add("Покебол");
|
||||
backpack.Add("Антидот");
|
||||
|
||||
Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {backpack.Count}");
|
||||
|
||||
backpack.Remove("Покебол");
|
||||
Console.WriteLine("Вы использовали один Покебол для поимки дикого покемона!");
|
||||
|
||||
Console.WriteLine($"Обновленный инвентарь. Осталось предметов: {backpack.Count}");
|
||||
|
||||
// task 3
|
||||
Console.WriteLine("\n--- Содержимое вашей сумки ---");
|
||||
foreach (string item in backpack)
|
||||
{
|
||||
Console.WriteLine($"[Предмет] -> {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("=============================");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>lab_04</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user