随机数的集合

来源:互联网 发布:win7与xp网络共享 编辑:程序博客网 时间:2024/06/16 09:57
/**The function to make a multitude of number randed from  time;the result returned from this function is a array buffer.**/int*  rdnum(){    //initial buff    int *data;    data=(int*)malloc(sizeof(int)*MAXSIZE);    //seed    srand((int)(::GetTickCount()));    //make rand number    for(int i=0; i<MAXSIZE; i++)    {        //control the number range from 10 to 99        data[i]=rand()%90+10;        //print the result immediately        cout<<data[i]<<" ";    }    //separated new line    cout<<endl;    return data;}

0 0