如题所说
解决方案 »
- 用Tmemorystream写入任意10进制的十六进制问题。
- 在使用dxdbgrid时发现它的右键菜单是英文的,请问在不增加快捷菜单的情况下怎么把它变成中文的
- 关于indy的图像传送的问题
- 高手指点:如何在一个模态窗口中打开另一个模态窗口并同时关闭前窗口
- delphi7如何才能使用ms sql作为数据库?
- 小问题呀
- 那位有ReportBuilder for d6?马上给分
- 有关delphi开发数据库的问题
- SQL2000的问题,在连接过程中出现SQLconnection property required for this operation
- 这是什么错误?????
- 论坛上的人为什么这样冷酷?
- TrackBar控件中怎么控制最后鼠标拖拽格?
谢谢 windindance(风舞轻扬)
我也没有更好的办法GZ
BCB5.0编译通过.
{
randomize();
int code;
int i,num=Form4->ListBox1->Items->Count,index,count;
for (i=0;i<Form4->ListBox1->Items->Count;i++)
card[i]=0;
for (code=1;code<=Form4->ListBox1->Items->Count;code++)
{
index=rand()%num;
count=0;
for (i=0;i<Form4->ListBox1->Items->Count;i++)
{
if (card[i]==0)
{
if (count==index)
{
card[i]=code;
break;
}
count++;
}
}
num--;
}
card[Form4->ListBox1->Items->Count]=2000;
}
len:integer;
i, Index: Integer;
temp:array of integer;begin len:=length(a);
setlength(temp,len); for i:=0 to high(temp) do temp[i]:=i+1;
//如果想要数值从0开始则temp[i];=i;
while Len>0 do
begin
Index:=Random(Len);
a[high(a)+1-Len]:=temp[Index];
temp[Index]:=temp[Len-1];
Len:=len-1;
end
end;