夏色祭 @ 2017-05-19 19:40:14
var
a:array[0..201,0..201]of longint;
b:array[0..201]of longint;
n,i,j,k,sum,max:longint;
function findmax:longint;
var
x,i,s:longint;
begin
x:=0;
s:=-maxlongint;
for i:=1 to n do
begin
inc(x,b[i]);
if x>s then s:=x;
if x<0 then x:=0;
end;
exit(s);
end;
begin
readln(n);
for i:=1 to n do
for j:=1 to n do
if j=n then readln(a[i,j])
else read(a[i,j]);
max:=-maxlongint;
for i:=1 to n do
begin
fillchar(b,sizeof(b),0);
for j:=i to n do
begin
for k:=1 to n do
inc(b[k],a[j,k]);
sum:=findmax;
if sum>max then max:=sum;
end;
end;
write(max);
end.
好像是子程序问题,求dalao指点
by fy2333 @ 2017-05-19 20:32:34
好像题解,自己不会对比一下吗?
by 夏色祭 @ 2017-05-20 10:05:28
读入问题
by 夏色祭 @ 2017-05-20 10:05:55
数据有毒,不能用readln