procedure substract(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]<0 then begin inc(c[i],10);dec(c[i+1]); end; while (len>1) and (c[len]=0) do dec(len); c[0]:=len; end;