Program summa;
Uses crt;
Const m=20;
Var a:array[1..m] of integer;
i,s:integer;
Begin
For i:=1 to m do
a[i]:=random(101)-50;
For i:=1 to m do
s:=s+a[i];
If s>50 then writeln('Сумма = ',s) else
for i:= 1 to m do
Writeln('Элемент массива №',i,' равен ',a[i]);
End.
или
Program summa;
Uses crt;
Const m=20;
Var a:array[1..m] of integer;
i,s:integer;
Begin
For i:=1 to m do
Readln(a[i]);
clrscr;
For i:=1 to m do
s:=s+a[i];
If s>50 then writeln('Сумма = ',s) else
for i:= 1 to m do
Writeln('Элемент массива №',i,' равен ',a[i]);
End.