From e2cd5fe128bbd73ac19884c26cc948fa96303084 Mon Sep 17 00:00:00 2001 From: gcn <57+gcn@noreply.localhost> Date: Tue, 24 Nov 2026 11:17:22 +0000 Subject: [PATCH] Add zadania 5 --- charp/daily/daily24.11-228.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/charp/daily/daily24.11-228.cs b/charp/daily/daily24.11-228.cs index 4da5c6d..ff93dec 100644 --- a/charp/daily/daily24.11-228.cs +++ b/charp/daily/daily24.11-228.cs @@ -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 Pokemon = new List() { "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() + { + } } }