ответ: 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 последняя версия, задача только на хз почему 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.
Объяснение:
#include <iostream>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
for (int i=a+1; i<b; ++i) cout<<i<<" ";
}