Beispiel #1
0
        public static Lists DelLast(this Lists Words)
        {
            int indexlast = Words.Count() - 1;

            Words.Delete(indexlast);
            return(Words);
        }
Beispiel #2
0
        public static void Sum(Lists Words)
        {
            string text = "";

            for (int i = 0; i < Words.Count(); i++)
            {
                text += Words.GetElement(i) + " ";
            }

            Console.WriteLine("Список в единую строку: " + text);
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public static void CountOfElem(Lists Words)
 {
     Console.WriteLine("Количество элементов в списке:" + Words.Count());
 }