1) файл паскаля приложен. 2) код на c# static void Main(string[] args) { int a, b; a = Convert.ToInt32(Console.ReadLine()); b = Convert.ToInt32(Console.ReadLine()); if (a > 2) { Console.WriteLine(a / 2); Console.WriteLine(b - 1); } } 3) Код на vb dim a as integer = 0 dim b as integer = 0 a = cint(console.readline()) b = cint(console.readline()) if a > 2 then console.writeline( a / 2) console.writeline(b - 1) end if
begin
var N, A, B, C, D: integer;
Readln(N, A, B, C, D);
if A > C then (A, B, C, D) := (C, D, B, A);
var s := 1.To(A - 1);
if B < C then // ( ) [ ]
s := s + B.Downto(A) + (B + 1).To(C - 1) +
D.Downto(C) + (D + 1).To(N)
else
if D < B then // ( [ ] )
begin
s := s + SeqGen(C - A, t -> B - t) +
SeqGen(D - C + 1, t -> t + A + B - D) +
SeqGen(B - D, t -> A - t + B - D - 1) + (B + 1).To(N)
end
else // ( [ ) ]
begin
s := s + SeqGen(C - A, t -> B - t) +
SeqGen(D - B, t -> D - t) + SeqGen(B - C + 1, t -> A + t) +
(D + 1).To(N);
end;
s.Println;
end.