int main()
{
int num =0;
int count =10;
int index;
int array[10] ={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
while (num <10) {
index = arc4random_uniform(count);
if (array[index]==-1) {
array[index]==num++;
}
}
return 0;
} 作者: cysummery 时间: 2015-4-6 23:34
是个好方法,老师也用过