//первая программа
var
x:array[1..10] of integer;
i:integer;
begin
for i := 1 to 10 do
begin
write('x[', i, '] = ');
readln(x[i]);
inc(x[i]);
end;
writeln;
writeln('Result');
for i := 1 to 10 do
write(x[i], ' ');
readln;
end.
//вторая программа
var
x:array[1..10] of integer;
i:integer;
begin
for i := 1 to 10 do
begin
write('x[', i, '] = ');
readln(x[i]);
if x[i] > 0 then
x[i] := 0;
end;
writeln;
writeln('Result');
for i := 1 to 10 do
write(x[i], ' ');
readln;
end.
// третья программа
var
x:array[1..10] of integer;
i:integer;
begin
for i := 1 to 10 do
begin
write('x[', i, '] = ');
readln(x[i]);
if x[i] < 0 then
x[i] := x[i] * x[i];
end;
writeln;
writeln('Result');
for i := 1 to 10 do
write(x[i], ' ');
readln;
end.
// четвертая программа
var
x:array[1..10] of integer;
i:integer;
begin
for i := 1 to 10 do
begin
write('x[', i, '] = ');
readln(x[i]);
if x[i] > 10 then
x[i] := x[i] + 2;
end;
writeln;
writeln('Result');
for i := 1 to 10 do
write(x[i], ' ');
readln;
end.