Var A: Array of Integer;
N: Integer;
i: Integer;
sum: Integer;
Begin
Randomize;
Write('N = ');
ReadLn(N);
SetLength(A, N + 1);
WriteLn('Массив:');
For i := 1 To N Do
Begin
A[i] := Random(50) - 25;
Write(A[i] + ' ');
End;
WriteLn;
WriteLn('Без отрицательных:');
For i := 1 To N Do Begin
If A[i] >= 0 Then
Write(A[i] + ' ');
End;
sum := 0;
WriteLn;
WriteLn('Среднее арифметическое:');
For i := 1 To N Do Begin
sum := sum + A[i];
End;
WriteLn(sum / N);
End.