产生随机数
{$apptype console}
program exp;
var a:array[1..100] of 1..100; i,j,k:integer;
begin
randomize;
for i:=1 to 100 do a[i]:=i;
for i:=1 to 100 do
begin
j:=random(100-i+1)+i;
if j<>i then begin k:=a[i];a[i]:=a[j];a[j]:=k; end;
end;
for i:=1 to 100 do write(a[i]:4);
end.
program exp;
var a:array[1..100] of 1..100; i,j,k:integer;
begin
randomize;
for i:=1 to 100 do a[i]:=i;
for i:=1 to 100 do
begin
j:=random(100-i+1)+i;
if j<>i then begin k:=a[i];a[i]:=a[j];a[j]:=k; end;
end;
for i:=1 to 100 do write(a[i]:4);
end.