Exemple #1
0
        public static void Swap <T>(List <GenericBox <T> > list, int firstPosition, int secondPosition)
        {
            GenericBox <T> oldFirstPosition = list[firstPosition];

            list[firstPosition]  = list[secondPosition];
            list[secondPosition] = oldFirstPosition;
        }
Exemple #2
0
        static void Main(string[] args)
        {
            int           n           = int.Parse(Console.ReadLine());
            List <double> genericList = new List <double>();

            for (int i = 0; i < n; i++)
            {
                double text = double.Parse(Console.ReadLine());
                genericList.Add(text);
            }

            double stringForCompare = double.Parse(Console.ReadLine());

            Console.WriteLine(GenericBox <double> .Compare(genericList, stringForCompare));
        }