===== PascalABC.NET =====
begin
var a := ReadArrReal(6);
var (i1, i2) := (a.IndexMax, a.IndexMin);
if i1 > i2 then
Swap(i1, i2);
a := a[i1 + 1:i2].Where(p -> p > 0).ToArray;
Print('Сумма', a.Length, 'элементов равна', a.Sum)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
===== PascalABC.NET =====
begin
var a := ReadArrReal(6);
var (i1, i2) := (a.IndexMax, a.IndexMin);
if i1 > i2 then
Swap(i1, i2);
a := a[i1 + 1:i2].Where(p -> p > 0).ToArray;
Print('Сумма', a.Length, 'элементов равна', a.Sum)
end.