再写了一遍
又变成10分了ovo
```cpp
program P1067;
var
n,m,i:longint;
a:array[1..3000] of longint;
begin
readln(n);
m:=n+1;
for i:=1 to n+1 do
read(a[i]);
for i:=1 to n-1 do
begin
if a[i]=0 then
begin
dec(n);
continue;
end;
if i=n-1 then
begin
if a[i]>0 then
write('+',a[i])
else
write(a[i]);
dec(n,1);
continue;
end;
if a[i]=1 then
begin
write('+x^',n);
dec(n);
continue;
end;
if a[i]=-1 then
begin
write('-x^',n);
dec(n);
continue;
end;
if (i<>1)and(a[i]>0) then
write('+',a[i],'x^',n)
else
write(a[i],'x^',n);
dec(n,1);
end;
if a[m]>0 then
write('+',a[m]);
if a[m]<0 then
write(a[m]);
end.
```
by chinazhengzehao @ 2017-08-15 18:35:18