sort and reverse

mail@pastecode.io avatar
unknown
css
2 years ago
482 B
3
Indexable
Never
double[] a = new double[5];
            int c = a.GetLength(0);
            for (int i = 0; i < c; i++)
            {
                a[i] = double.Parse(Console.ReadLine());
            }
            Array.Sort(a);
            Array.Reverse(a);

            Console.WriteLine("-----------------------------------------");
            for (int i = 0; i < c; i++)
            {
                Console.WriteLine(a[i]);
            }

                Console.ReadKey();