generated from admin/template
Add zadania 5
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@@ -111,10 +112,27 @@ namespace ConsoleApp
|
|||||||
static void Zadania_5()
|
static void Zadania_5()
|
||||||
{
|
{
|
||||||
List<string> Pokemon = new List<string>() { "Pokemon 1", "Pokemon 2", "Charmander", "Pokemon 4" };
|
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.Remove("Pokemon 2");
|
||||||
Pokemon.Add("Pokemon 5");
|
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()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user