var
a,b:array[-20..2000,-20..2000] of longint ;
i,j,k,m,n,z,x,y: longint;
begin
read(x,y,m,n);
b[m,n]:=-1;
b[m-2,n-1]:=-1;
b[m-1,n-2]:=-1;
b[m+1,n-2]:=-1;
b[m+2,n-1]:=-1;
b[m-2,n+1]:=-1;
b[m-1,n+2]:=-1;
b[m+1,n+2]:=-1;
b[m+2,n+1]:=-1;
a[0,0]:=1;
for j:= 0 to y do
for i:= 0 to x do
begin
if b[i-1,j]=0 then a[i,j]:=a[i,j]+a[i-1,j];
if b[i,j-1]=0 then a[i,j]:=a[i,j]+a[i,j-1];
end;
write(a[x,y]);
end.
你慢慢看。。。真的很恶心。。。。。
program li;
var n,m,x,y,i,j,k,t:longint;
a,b:array[-10..100,-10..100] of int64;
begin
read(n,m,x,y);
fillchar(a,sizeof(a),0);
fillchar(b,sizeof(b),0);
a[x,y]:=1;
a[x+1,y+2]:=1; a[x+1,y-2]:=1;
a[x-1,y+2]:=1; a[x-1,y-2]:=1;
a[x+2,y+1]:=1; a[x+2,y-1]:=1;
a[x-2,y+1]:=1; a[x-2,y-1]:=1;
for i:=1 to n do if a[i,-1]=0 then b[i,-1]:=1;
for i:=1 to m do if a[-1,i]=0 then b[-1,i]:=1; b[-1,-1]:=1;
for i:=0 to n do
for j:=0 to m do
begin
if (i=0) and (a[i,j]=0) then b[i,j]:=b[i,j-1];
if (j=0) and (a[i,j]=0) then b[i,j]:=b[i-1,j];
if (i=0) and (j=0) then b[i,j]:=1;
if (i>0) and (j>0) then
if a[i,j]=0 then b[i,j]:=b[i-1,j]+b[i,j-1] else b[i,j]:=0;
end;
write(b[n,m]);
end.