<>function [y,m,n]=go(A,m,n,y0)
for i=1:6
for j=i+1:6
B=A;
B(i)=0;
B(j)=0;
if sum(B(1:3))>sum(B(4:6))&m~=i&n~=j
A=B;
y=[y0 sum(A(1:3)) sum(A(4:6))];
m=i;
n=j;
back(~A,m,n,y);
return
end
end
end</P><>~~~~~~~~~~~~~~</P><>function [y,m,n,h]=back(A,m,n,y0)
for h=0:1
for i=1:6
for j=i+1:6
B=A;
B(i)=B(i)-1;
B(j)=B(j)-h;
if sum(B(1:3))>sum(B(4:6))&m~=i&(n~=j|~h)&sum(A)~0
A=B;
m=i;n=j;
y=[y0 sum(~B(1:3)) sum(~B(4:6))]
go(~A,m,n,y);
return
elseif sum(A)==0
return
end
end
end
end
~~~~~~~</P><P>A=[1 1 1 1 1 1];
[x,m,n]=back(A,0,0,[])</P><P>还是不能运行</P><P>太郁闷了</P>[em03][em03][em03][em03][em03][em03][em03] |