Add zadania 5

This commit is contained in:
gcn
2026-11-24 11:17:22 +00:00
parent f55ffc13bf
commit e2cd5fe128
+19 -1
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@@ -111,10 +112,27 @@ namespace ConsoleApp
static void Zadania_5()
{
List<string> Pokemon = new List<string>() { "Pokemon 1", "Pokemon 2", "Charmander", "Pokemon 4" };
Console.WriteLine($"Количество покимонов: {Pokemon.Count}");
for (int i = 0; i < Pokemon.Count; i++)
{
Console.WriteLine($"{i}:{Pokemon[i]}");
}
Pokemon.Remove("Pokemon 2");
Pokemon.Add("Pokemon 5");
string otvet = [""];
Console.WriteLine($"\n Новое количество: {Pokemon.Count}");
bool estCharmander = Pokemon.Contains("Charmander");
string otvet = estCharmander ? "Да, Charmander есть в команде" : "Нет, Charmander отсутствует";
Console.WriteLine(otvet);
}
static void Zadania_6()
{
}
}
}