ответ: Pascal последняя версия, задача только на хз почему 1 неправильно
program C1;
var
N, x: int64;
begin
read(x);
read(N);
if (N > 0) and (N <= abs(x)) then
x := x + n
else if (N > 0) and (N >= abs(x)) then
x := x + n + 1;
if (N < 0) and (abs(N) <= abs(x)) then
x := x - abs(N)
else
if (N < 0) and (abs(N) >= abs(x)) then
x := x - abs(N) - 1;
if x <> 0 then
writeln(x)
else begin
if N > x then
x := x +1
else
x := x -1;
writeln(x);
end;
end.
Объяснение:
Поделитесь своими знаниями, ответьте на вопрос:
Нарисовать этот паровоз в pascal abс
a : array [1..5, 1..5] of integer;
i, j : integer;
begin
randomize;
for i := 1 to 5 do
begin
for j := 1 to 5 do
begin
a[i, j] := random (1000);
write (a[i, j], ' ');
end;
writeln;
end;
for i := 1 to 5 do
for j := 1 to 5 do
if i > j then a[i, j] := 1
else if j > i then a[i, j] := 0;
for i := 1 to 5 do
begin
for j := 1 to 5 do
write (a[i, j], ' ');
writeln;
end;
end.
var
a : array [1..4, 1..5] of integer;
i, j, m, c : integer;
begin
randomize;
m := 1000;
for i := 1 to 4 do
begin
for j := 1 to 5 do
begin
a[i, j] := random (1000);
if a[i, j] < m then m := a[i, j];
write (a[i, j], ' ');
end;
writeln;
end;
c := 0;
for i := 1 to 4 do
for j := 1 to 5 do
if a[i, j] = m then
c := c + 1;
writeln (m, ' ', c);
end.
var
a : array [1..4, 1..4] of integer;
i, j, p : integer;
begin
randomize;
for i := 1 to 4 do
begin
for j := 1 to 4 do
begin
a[i, j] := random (10);
write (a[i, j], ' ');
end;
writeln;
end;
p := 1;
for i := 1 to 4 do
begin
if a[i, i] <> 0 then p := p * a[i, i];
if a[i, 5 - i] <> 0 then p := p * a[i, 5 - i];
end;
writeln (p);
end.