public static Lists DelLast(this Lists Words) { int indexlast = Words.Count() - 1; Words.Delete(indexlast); return(Words); }
public static void Sum(Lists Words) { string text = ""; for (int i = 0; i < Words.Count(); i++) { text += Words.GetElement(i) + " "; } Console.WriteLine("Список в единую строку: " + text); }
public static string WordMax(this Lists Words) { int max = Words.GetElement(0).Length; int index_max = 0; for (int i = 0; i < Words.Count(); i++) { if (Words.GetElement(i).Length > max) { index_max = i; } } return(Words.GetElement(index_max)); }
public static void Max_Min(Lists Words) { int max = Words.GetElement(0).Length; int min = Words.GetElement(0).Length; for (int i = 0; i < Words.Count(); i++) { if (Words.GetElement(i).Length > max) { max = Words.GetElement(i).Length; } if (Words.GetElement(i).Length < min) { min = Words.GetElement(i).Length; } } int max_min = max - min; Console.WriteLine("Разница символов максимальнонго и минимального слова:" + max_min); }
public static void CountOfElem(Lists Words) { Console.WriteLine("Количество элементов в списке:" + Words.Count()); }