program project1;
const
max=10;
var
m,n:integer;
a:array[1..max,1..max] of integer;
b,c,d:array[1..max] of integer;
ro:integer;
ra:integer;
procedure duru;
var
fin:text;
i,j,y:integer;
begin
assign(fin,'horse.in');
reset(fin);
read(fin,m,n);
ro:=maxint;
ra:=-maxint;
for i:=1 to m do
for j:=1 to n do
begin
readln(fin,a[i,j]);
if a[i,j]<ro then begin ro:=a[i,j];b[i]:=a[i,j]; end;
if a[i,j]>ra then begin ra:=a[i,j];c[i]:=a[i,j]; end;
end;
close(fin);
end;
procedure shuchu;
var
fout:text;
i,j:integer;
begin
assign(fout,'horse.out');
rewrite (fout);
begin
for i:=1 to m do
for j:=1 to n do
if (a[i,j]=b[i]) and (a[i,j]=c[i]) then
begin
d[i]:=a[i,j];
writeln(d[i]);
end
else
writeln('no');
end;
close(fout);
end;
begin
duru();
shuchu();
end.
太晚编的,思维有些混乱,请指出怎么错了(注:horse.in有测试数据,ro代表行,ra代表列,m,n分别是测试数据中的代表行列 如
5{行} 5{列}
5 6 7 8 9
4 5 6 7 8
3 4 5 2 1
2 3 4 9 0
1 2 5 4 8
若错的太多,请用过程、函数重写帮我写,思路最好和我一样,谢谢!!