Const N = 13; Var A:array[1..N] of integer; i:integer; S:real; Begin Randomize; Write('Исходный массив:'); For i:= 1 to N do Begin A[i]:=random(2*N+1)-N; Write(' ',A[i]); if (i mod 2 = 0)and(A[i] < 0) then S:=S+A[i] End; WriteLn; WriteLn('S = ',S); ReadLn; End.
N = 13;
Var
A:array[1..N] of integer;
i:integer;
S:real;
Begin
Randomize;
Write('Исходный массив:');
For i:= 1 to N do
Begin
A[i]:=random(2*N+1)-N;
Write(' ',A[i]);
if (i mod 2 = 0)and(A[i] < 0) then S:=S+A[i]
End;
WriteLn;
WriteLn('S = ',S);
ReadLn;
End.