In a one-dimensional array, consisting of real elements, calculate:

  • B) the sum of the elements of the array located between the maximum and minimum elements.
  • C) the product of elements whose values ​​are not included in the interval. Values ​​set from the keyboard.
  • D) sort the array by the insert method.

    1 answer 1

    1. Find the indices of the maximum and minimum values ​​(we assume, imin and imax). It is very simple. Next, we summarize the values ​​of the elements from imin + 1 to imax-1.
    2. We count the product of elements with indices from 0 to imin-1 and from imax + 1 to the end.
    3. The Internet is full of materials. Learn to use Google.
    • eight
      for a ready-made solution, you should turn to a classmate, feeding him with candies and smacking his nose. - VladD 1:16
    • one
      Find yourself a man with a car, money and an apartment. And drop this programming - teanUC
    • one
      That's how two loneliness found each other ... - skegg
    • 2
      @MARINOKA, for a start, enter the array from the keyboard, find in it (one by one, for a start) the minimum and maximum elements and type their indices. To begin with, in the total cycle there is a minimum, and in the other a maximum. In a few minutes (sure) you will need one cycle to find them. Then it will go easier. Those. if the whole task (I hope, for now) does not work out, then select a meaningful piece from it and program it. Then add something else, then a third, and go ... - avp
    • one
      my decision on js: https://gist.github.com/4155038 - Specter