求NOIP1997标程

来源:百度知道 编辑:UC知道 时间:2024/05/17 17:40:08
最好是C++,普及组和提高组都要

百度找

我不知道题 给你马拦过河卒的做法吧
var a:array[0..20,0..20] of integer;
x,y,i,n,m,v,j,c:integer;
begin
readln(n); readln(m); readln(x); readln(y);
for i:=1 to m do
a[i,0]:=1;
for j:=1 to n do
a[0,j]:=1;
a[x,y]:=0;
a[x-2,y-1]:=0;
a[x-2,y+1]:=0;
a[x-1,y-2]:=0;
a[x-1,y+2]:=0;
a[x+1,y-2]:=0;
a[x+1,y+2]:=0;
a[x+2,y-1]:=0;
a[x+2,y+1]:=0;

if x-2=0 then
for j:=y-1 to m do
a[0,j]:=0;
if y-2=0 then
for i:=x-1 to n do
a[i,0]:=0;

if x-1=0 then
for j:=y-2 to m do
a[0,j]:=0;
if y-1=0 then
for i:=x-2 to n do
a[i,0]:=0;

if x=0 then
for j:=y to m do
a[0,j]:=0;
if y=0 then
for i:=x to n do
a[i,0]:=0;

for i:=1 to n do