var a:array[1..1000] of integer; i,n,j:integer; begin readln(n); for i:=1 to n do begin read(a[i]); a[i+n]:=a[i]; end; for i:=1 to n do write(a[i],' '); writeln; for i:=1 to n-1 do begin for j:=1 to n do write(a[i+j],' '); end; end. 求解读
最新回答
南故归
2024-10-23 03:33:42
for i:=1 to n dobeginread(a[i]);a[i+n]:=a[i];end; 读入n个数a[1]~a[n],同时保存一份一样的到a[1+n]~a[n+n];执行完成后数组内容像这样: 7 4 8 9 1 5 7 4 8 9 1 5
for i:=1 to n dowrite(a[i],' ');writeln; 将a中前n个数输出:7 4 8 9 1 5
for i:=1 to n-1 dobeginfor j:=1 to n dowrite(a[i+j],' ');end;end.