Program sum;uses Crt;Var i: integer; sum, p, sr : real; a : array [1..25] of real;beginClrscr;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.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
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.