S
S
serik2020-05-26 19:11:24
C++ / C#
serik, 2020-05-26 19:11:24

How to solve an array problem?

In the sequence a1, ..., a10, all elements behind the element with the largest value (first in order, if there are several), increase by one.

double[] a = new double[10];
            for (int i=0;i<10;i++ )
            {
                Console.Write("Введите число A[" + i + "]: ");
                a[i] = double.Parse(Console.ReadLine());
            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#, 2020-05-27
@black_xe

- find the index of the element with the largest value google C# search for the maximum in the array - increase the
found index
by one - in a loop from this index to the end of the array, increase all elements by one

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question