示例#1
0
        static void Main(string[] args)
        {
            Box <double> myBox = new Box <double>();

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

            for (int i = 0; i < n; i++)
            {
                double input = double.Parse(Console.ReadLine());

                myBox.Add(input);
            }

            //int[] indexes = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            // myBox.Swap(indexes[0], indexes[1]);

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

            myBox.Compare(stringToCompare);

            Console.WriteLine(myBox.CountGreater);

            //var result = myBox.ToString();

            // Console.WriteLine(result);
        }
示例#2
0
        public static void Main(string[] args)
        {
            Box <double> box = new Box <double>();

            int count = int.Parse(Console.ReadLine());

            for (int i = 0; i < count; i++)
            {
                double input = double.Parse(Console.ReadLine());

                box.Add(input);
            }

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

            box.Compare(box.boxCollection, comparer);

            Console.WriteLine(box.Count);
        }
        static void Main(string[] args)
        {
            var box = new Box <double>();

            int count = int.Parse(Console.ReadLine());


            for (int i = 0; i < count; i++)
            {
                //int input = int.Parse(Console.ReadLine());
                double input = double.Parse(Console.ReadLine());

                box.Add(input);
            }

            var item = double.Parse(Console.ReadLine());

            box.Compare(item);

            Console.WriteLine(box.Count);
        }