大牛们看看我哪里错了,第三个点过不了。

Var
n,a,i,l,k:integer;
Begin
readln(n);
l:=n;
k:=1
for i:=1 to n+1 do
begin
read(a);
if a=0 then
begin
dec(n);
continue;
end;
if i=l then
begin
if a>0 then
write('+');
write(a,'x');
inc(k);
continue;
end;
if i=l+1 then
begin
if a>0 then
write('+');
writeln(a);
inc(k);
continue;
end;
if abs(a)=1 then
if a<0 then
begin
write('-x^',n);
dec(n);
inc(k);
continue;
end
else
if a>0 then
begin
if k>1 then write('+');
write('x^',n);
dec(n);
inc(k);
continue;
end;
if (a>0) and (k>1) then
write('+');
write(a,'x^',n);
dec(n);
inc(k);
end;
readln;
End.

1 条评论

  • @ 2017-01-27 19:01:31

    说错了,不是第三个点,是第二个点。

  • 1

信息

ID
1812
难度
5
分类
(无)
标签
递交数
2044
已通过
658
通过率
32%
被复制
14
上传者