procedure plus ( a,b:hp; var c:hp); var i,len:integer; begin fillchar(c,sizeof(c),0); if a[0]>b[0] then len:=a[0] else len:=b[0]; for i:=1 to len do begin inc(c[i],a[i]+b[i]); if c[i]>10 then begin dec(c[i],10); inc(c[i+1]); end; {进位} end; if c[len+1]>0 then inc(len); c[0]:=len; end;{plus}