СРОЧНО!!!!
таблица a[1,25] найти сумму положительных элементов таблицы, произведение отрицательных, среднее арифметическое всех элементов
Program sum;
uses Crt;
Var i: integer;
sum, p, sr : real;
a : array [1..25] of real;
begin
Clrscr;
For i:=1 to 25 do
begin
write (a[,i,]=);
readln(a[i]);
end;
sum:=0;
For i:=1 to 25 do begin
if a[i]>0 then sum:=sum+a[i];
end;
sr:=sum/25;
For i:=1 to 25 do begin
if a[i]<0 then p:=p*a[i];
end;
Writeln (Sum=,sum:5:2);
Writeln (p=,p:5:2);
Writeln (Sr=,sr:5:2);
readln;
end.
Оцени ответ
