Eh, I didnβt write from 1 course on C. The author made small attempts to create a program, it is simple, I suggest to help.
I tried to correct the question in order to have at least some benefit. If you think that this is still a decision for the author and the question is useless in the future, then I will delete the answer.
ideone
#include <stdio.h> int main(void) { int mass[] = {2, 2, -3, 1, 5}; // ΡΡΠ°Π·Ρ Π·Π°ΠΏΠΎΠ»Π½ΠΈΠΌ ΠΌΠ°ΡΡΠΈΠ² int N = sizeof (mass) / sizeof (int); // ΡΠ·Π½Π°Π΅ΠΌ Π΅Π³ΠΎ Π΄Π»ΠΈΠ½Ρ double min = mass[0], max = mass[0], pr = 1; //for(int i = 0 ; i<N ; i++) // scanf (&mass[i]); for(int i = 0 ; i<N ; i++) { printf ("%d, ", mass[i]); if (min > mass[i]) // ΠΈΡΠ΅ΠΌ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΡΠΉ ΡΠ»Π΅ΠΌΠ΅Π½Ρ min = mass[i]; if (max < mass[i]) // ΠΈΡΠ΅ΠΌ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΡΠΉ ΡΠ»Π΅ΠΌΠ΅Π½Ρ max = mass[i]; } printf ("\n"); min = min / 2; // Π΄Π΅Π»Π°Π΅ΠΌ ΡΡΠΈ Π³ΡΠ°Π½ΠΈΡΡ min/2 ΠΈ max/2 max = max / 2; for (int i = 0; i < N; i++) { if (mass[i] >= min && mass[i] <= max) { pr = pr * mass[i]; // Π½Π°Ρ
ΠΎΠ΄ΠΈΠΌ ΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΠ΅ ΡΠ΅Ρ
ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ², ΠΊΠΎΡΠΎΡΡΠ΅ Π² Π΄Π°Π½Π½ΠΎΠΌ ΠΎΡΡΠ΅Π·ΠΊΠ΅ } } mass[0] = pr; // Π·Π°ΠΌΠ΅Π½ΡΠ΅ΠΌ mass[N-2] = pr; for(int i = 0 ; i<N ; i++) { printf ("%d, ", mass[i]); // profit } return 0; }