主题:帮帮忙,快点
帮帮忙改一下这个pascal 程序 谢谢
var a:=array[1..10] of integer; i,n1,n2:integer;p,q:real;
begin
for i:=1to 10 do read(a[i]);
readln;
for n1:=2*i,n2:=2*i-1 do
begin
p:=0;q:=0 ;
if i=n1 then
write(a[i],p:p+a[i]);
if i=n2 then
begin
q:=q+a[i];wrtite(a[i]);
end;
end;
write(q/5);
end.
帮忙改一下里面的语法错误,谢谢!
var a:=array[1..10] of integer; i,n1,n2:integer;p,q:real;
begin
for i:=1to 10 do read(a[i]);
readln;
for n1:=2*i,n2:=2*i-1 do
begin
p:=0;q:=0 ;
if i=n1 then
write(a[i],p:p+a[i]);
if i=n2 then
begin
q:=q+a[i];wrtite(a[i]);
end;
end;
write(q/5);
end.
帮忙改一下里面的语法错误,谢谢!