//Pascal var A: array [1 .. 5] of integer; k, buf, i, j: integer; ArithMean: real; begin for i := 1 to 5 do begin write('A[', i, '] = '); readln(A[i]); ArithMean := ArithMean + A[i]; end; for i := 1 to 5 - 1 do begin k := i; for j := i + 1 to 5 do if A[j] < A[k] then k := j; buf := A[i]; A[i] := A[k]; A[k] := buf; end; for i := 1 to 5 do write(A[i]:4); writeln; writeln('Среднее арифметическое = ', (ArithMean / 5):0:2); end.
var
A: array [1 .. 5] of integer;
k, buf, i, j: integer;
ArithMean: real;
begin
for i := 1 to 5 do
begin
write('A[', i, '] = '); readln(A[i]);
ArithMean := ArithMean + A[i];
end;
for i := 1 to 5 - 1 do
begin
k := i;
for j := i + 1 to 5 do
if A[j] < A[k] then k := j;
buf := A[i];
A[i] := A[k];
A[k] := buf;
end;
for i := 1 to 5 do write(A[i]:4);
writeln;
writeln('Среднее арифметическое = ', (ArithMean / 5):0:2);
end.