Вот код:
USES CRT;
Var
A, B: BOOLEAN;
Ai, Bi, C, D: REAL;
Begin
CLRSCR;
TextColor(10);
writeln('The program is showing the operation of the algorithms branching structure');
writeln('');
TextColor(20);
writeln('To continue, press "ENTER" ...');
TextColor(8);
ReadLN;
writeln('Enter the type BOOLEAN variable A (0 or 1).'); READ(Ai);
If Ai<>0 then
If Ai<>1 then
writeln('No = !')
eLse
If Ai=1 then
A:= TRUE
eLse
A:= FALSE;
writeln('Enter the type BOOLEAN variable B (0 or 1).'); READ(Bi);
If Bi<>0 then
If Bi<>1 then
writeln('No = !')
eLse
If Bi=1 then
B:= TRUE
eLse
B:= FALSE;
writeln('Enter the type INTEGER variable C.'); READ©;
writeln('Enter the type INTEGER variable D.'); READ(D);
IF ((A=B) AND (C>D)=TRUE OR NOT A)
THEN IF ((TRUE<>A) AND (C-D<3))
THEN writeln('S1')
ELSE writeln('S2')
ELSE writeln('S3');
END.