var
a:array[1..n,1..n] of integer;
b:array[1..n,1..n] of integer;
TopsB:array[1..n] of integer;
arr:array[1..n] of integer;
start:array[1..n] of integer;
arrVar:array[1..n]of integer;
TopA,ind,i,j:integer;
procedure check(vec:array[1..n]of integer);
var
i,j,k:integer;
sumA,sumB,summ:integer;
begin
writeln(TopA,' topA');
for i:=1 to n do
begin
arr[i]:=0;
end;
if((TopA>=1)and(TOpA<5)) then
begin
sumA:=0;
for i:=1 to n do
begin
sumA:=sumA+a[TopA,i];
end;
for i:=1 to n do
begin
{******************}
for k:=1 to n do
begin
writeln(vec[k],' vec ',k);
end;
if ((vec[i]>0)and(isFree(i))) then
begin
sumB:=0;
for j:=1 to n do
begin
sumB:=sumB+b[i,j]
end;
if(sumA=SumB) then
begin
arr[i]:=1;
TopsB[ind]:=i;
ind:=ind+1;
TopA:=Topa+1;
for k:=1 to n do
begin
arrVar[i]:=b[i,k];
end;
check(arrVar);
end;
end;
end;
end;
summ:=0;
for i:=1 to n do
begin
summ:=summ+arr[i];
end;
if(summ<=0) then
begin
TopA:=TopA-1;
ind:=ind-1;
end
else if(TopA<=0) then
begin
writeln('no');
end
else if(TopA>=n) then
begin
writeln('yes');
end;
end;
Проблема ис входным параметром рекурсивной процедуры |