波莱罗 2011-09-08 21:39:00
点我顶贴
收藏
删除
为什么总是会连着输出两个负号?
Program syw0017;
var n,i:integer; a:array[1..200]of integer;
begin
read(n);
for i:=0 to n do read(a[i]);
for i:=0 to n do
begin
if (a[i]=0) then continue;
if (a[i]>0) and (i>0) then write('+');
if (a[i]<0) then write('-');
if abs(a[i])=1 then write('x');
if abs(a[i])>1 then write(a[i],'x');
if (i<n) then write ('^',n-i);
if (i=n) then write(a[i]);
end;
end.