
Please, help me!
[pascal]Program p10326;
Const MaxN = 50;
Eps = 1e-3;
Type TEqu = Array[0..MaxN]of Comp;
Var N,i,j,ok : Integer;
R : Array[1..MaxN]of Comp;
Ans : TEqu;
Procedure WriteEqu(E : TEqu);
Var i : Integer;
f : boolean;
begin
f:=true;
for i:=MaxN downto 1 do
if Abs(E)>eps then begin
if E<-eps then Write(' - ');
if (E>-eps)and(not f) then Write(' + ');
f:=false;
if Abs(Abs(E)-1)>eps then Write(Abs(E):0:0);
Write('x');
if i>1 then Write('^',i:0);
end;
if not f then begin
if E[0]<-eps then Write(' - ') else Write(' + ');
end else
if E[0]<-eps then Write('- ');
Writeln(Abs(E[0]):0:0,' = 0');
end;
Procedure AddTo(Var E : TEqu; A : Comp);
Var i : Integer;
F : TEqu;
begin
for i:=1 to MaxN do F:=E[i-1];
F[0]:=0;
for i:=0 to MaxN-1 do
if Abs(E)>eps then F:=F-E*A;
E:=F;
end;
begin
While Not Eof(InPut) do begin
Read(N);
for i:=1 to N do Read(R[i]);
if Eoln(InPut) then Readln;
for i:=1 to MaxN do Ans[i]:=0;
Ans[0]:=1;
for i:=1 to N do AddTo(Ans,R[i]);
WriteEqu(Ans);
end;
end.[/pascal]