如题,谢谢

解决方案 »

  1.   

    Randomize;  //初始化
    Random(范围);  //产生随机数
      

  2.   

    先给出一个100个元素数组。
    随机函数取走一个作为b[1]
    剩下再作为一个整体,又随机取走一个作为 b[2]...
    ........b[99]..b[100]
      

  3.   

    先初始化目标数组to为空,count:=0;postion:=0;
      while  count<100 do   begin
             i:=randmom(100);
             if to[i]=' ' then  begin
                    to[i]:=from[position];
                    postion:=position+1;
                   count:=count+1;
                  end;
        end;
      

  4.   

    1. a[100] 有内容 ,b[100] 空的2. 生成 1..100 随机数 i
    3. b[1]=a[i]; a[i]=a[100]
    4. 生成 0..99 随机数 i
    5. b[2]=a[i]; a[i]=a[99]
    6. 生成 0..98 随机数 i
    7. b[3]=a[i]; a[i]=a[98]
    ....
    ....
      

  5.   

    random(100)好像不會出現100的....random(100)+1
      

  6.   

    randomize;
    for x:=1 to 100 do
     b[x]:=a[random(100)+1]
    不知是否可以..
      

  7.   

    有randomize....................的啊~~~~~~~~~~~~~~~~€
      

  8.   

    randomize重复的可能性很高, 不过你可以自己找一些好的随机算法...
      

  9.   

    用了randomize和random的次數不算多,但不曾出現過重复的情況,請指教
      

  10.   

    random(n),n别太大!再试试!以时间做为种子,取小于n个很可能重复?用上面的几种方法重复也无妨!何况不会出现很高的重复率!
      

  11.   

    其实就是随即产生100个100以内的随机数!: myy() 
    办法不错!
      

  12.   

    最简单的方法,使用:uses strUtils;
    function RandomFrom(const AValues: array of string): string; overload;