164)
var a: array [1..10] of real;
i: integer;
begin
for i := 1 to 10 do
begin
a[i] := random(100) - 50;
writeln('[', i, '] => ', a[i]);
end;
writeln('------------');
for i := 1 to 10 do
begin
a[i] := sqr(a[i]);
writeln('[', i, '] => ', a[i]);
end;
end.
169)
var a: array [1..10] of real;
i, s: integer;
begin
for i := 1 to 10 do
begin
a[i] := random(100) - 50;
writeln('[', i, '] => ', a[i]);
end;
writeln('------------');
for i := 1 to 10 do
begin
if (A[i] < 0) then s := s + a[i];
end;
writeln(s);
end.
172)
var a: array [1..10] of real;
i, s: integer;
begin
for i := 1 to 10 do
begin
a[i] := random(100) - 50;
writeln('[', i, '] => ', a[i]);
end;
writeln('------------');
for i := 1 to 10 do
begin
if (A[i] <> 0) then s := s + 1;
end;
writeln(s);
end.
174)
var a: array [1..10] of real;
i, s: integer;
b: real;
begin
for i := 1 to 10 do
begin
a[i] := random(100) - 50;
writeln('[', i, '] => ', a[i]);
end;
writeln('------------');
for i := 1 to 10 do
begin
b := b + a[i];
end;
b := b / 10;
for i := 1 to 10 do
begin
if (a[i] > b) then s := s + 1;
end;
writeln(s);
end.
179)
var a: array [1..10] of real;
i, s: integer;
begin
for i := 1 to 10 do
begin
a[i] := random(100) - 50;
writeln('[', i, '] => ', a[i]);
end;
writeln('------------');
for i := 1 to 10 do
begin
if (i mod 2 = 0) then a[i] := sqr(a[i]);
writeln('[', i, '] => ', a[i]);
end;
end.
Вроде так =)