N . - .
Begin
Integer , , ;
:=0;
:=N;
:=1;
Parbegin
: begin
n1: ;
P();
P();
;
V();
V();
Goto n1;
End;
: begin
n2: P();
P();
;
V();
V();
;
Goto n2;
End;
Parend;
End;
. : . : . ( ), ¾ ( ).
.
.
.
.
, . , . - (, ), .
, . , .
.
, . , . . , . - . .
- - , , .
, , : , , . , , .
: N ¾ ; M ¾ ; RB ¾ .
|
|
Begin
integer array [1:N], [1:N];
Integer , , , , i;
for i:=1 step 1 until N do begin
[i]:=0;
[i]:=0;
End;
:=0; :=RB;
:=0; :=1;
Parbegin
1: begin... end;
................
n: begin integer ;
n: ();
P();
if ((=0) and ( ≥ )) then
:=-;
Else
Begin
:=+1;
[n]:=;
V();
P([n]);
P();
End;
;
V();
V();
Goto n;
End;
.........
N: begin... end;
1: begin... end;
.........
m: begin
Integer , i, max, nmax;
m: P();
P();
;
:=+;
: if (>0) then
Begin
max:=0;
for i:=1 step 1 until N do
Begin
if (max<[i]) then
Begin
max:=[i];
nmax:=i;
End;
End;
if (max ≤ ) then
Begin
:=-max;
[nmax]:=0;
:=-1;
V([nmax]);
Goto ;
End;
End;
V();
;
Goto m;
end;
- , , , . - , - .
( ).
( ), , .. , .
, . , , ( ). ( ). ( ), , - , , , , >0, , .