计算两高精度实数的乘法.
program lxw012;
const n1=250; n2=500;
type strn=string[250];
intn22=array [-1..500] of integer;
var a1,b1,c1:intn22;
ch1,ch2:strn;
i:integer;
procedure chtoint2(ch:strn; var a:intn22);
var i,j,t,dot:integer;
begin
for i:=1 to n2 do a[i]:=0;
a[0]:=1; j:=0; dot:=0;
for i:=1 to length(ch) do
case ch[i] of
’0’..’9’: begin j:=j+1; a[j]:=ord(ch[i])-ord(’0’) end;
’.’: dot:=j;
’-’: a[0]:=-1
else
end;
if dot=0 then dot:=j;
t:=0;
repeat t:=t+1 until a[t]>0;
a[-1]:=dot-t+1;
if t>1 then
begin
此文共有4页 上一页 1 2 3 4 下一页 |