主题:考考你!
把这个程序的错误全部更正
谢谢,必有重谢
program guoyuan;
var
m,n,p,q,d,e,s1,s2,s:integer;
a,b:array[1..31] of integer;
begin
read(m,n);
readln(p);
for d:=1 to p do begin
read(a[d]);
readln(q);
for e:=1 to q do
read(b[e]);
for d:=1 to p do begin
for e:=1 to q do begin
if a[d]<=b[e] then begin
{----bijiao----}
s1:=s1+(b[e]-a[d])*a[d+1];
if (e>=2) and (e mod 2<>0) and (e<q) then begin
s2:=s2+a[d]*(m+b[e-1]);
if e<2 then
s2:=s2+a[d]*m;
if e=q then
s2:=s2+a[d]*n;
end;
{-----a[d]<=b[e]qingkuang----}
else
s1=s1+(a[d]-b[e])*b[e+1];
if d>=2 and (d mod 2<>0) and d<p then begin
s2:=s2+b[e]*(m+a[d-1]);
if d<2 then
s2:=s2+b[e]*m;
if d=p then
s2=s2+b[e]*n;
end;
end;
end;
end.
谢谢,必有重谢
program guoyuan;
var
m,n,p,q,d,e,s1,s2,s:integer;
a,b:array[1..31] of integer;
begin
read(m,n);
readln(p);
for d:=1 to p do begin
read(a[d]);
readln(q);
for e:=1 to q do
read(b[e]);
for d:=1 to p do begin
for e:=1 to q do begin
if a[d]<=b[e] then begin
{----bijiao----}
s1:=s1+(b[e]-a[d])*a[d+1];
if (e>=2) and (e mod 2<>0) and (e<q) then begin
s2:=s2+a[d]*(m+b[e-1]);
if e<2 then
s2:=s2+a[d]*m;
if e=q then
s2:=s2+a[d]*n;
end;
{-----a[d]<=b[e]qingkuang----}
else
s1=s1+(a[d]-b[e])*b[e+1];
if d>=2 and (d mod 2<>0) and d<p then begin
s2:=s2+b[e]*(m+a[d-1]);
if d<2 then
s2:=s2+b[e]*m;
if d=p then
s2=s2+b[e]*n;
end;
end;
end;
end.