Код на Паскале: program z6; var i, b, z: integer; a: array [1..10] of integer;
BEGIN for i:=1 to 10 do begin a[i]:=i*i; writeln (i, ' = ' , a[i]); end; writeln; writeln; b:=a[10]; for i:=0 to 8 do begin a[10-i]:=a[9-i]; z:=10-i; writeln (z, ' = ' , a[10-i]); end;
Код на Паскале:
program z6;
var i, b, z: integer;
a: array [1..10] of integer;
BEGIN
for i:=1 to 10 do begin a[i]:=i*i;
writeln (i, ' = ' , a[i]);
end;
writeln;
writeln;
b:=a[10];
for i:=0 to 8 do begin
a[10-i]:=a[9-i];
z:=10-i;
writeln (z, ' = ' , a[10-i]);
end;
a[1]:=b;
writeln('1 = ', a[1]);
END.