//注意:这两个头文件不可以缺少
#include<ctime>
#include<cstdlib>
srand((unsigned)time(NULL));
for(i=0;i<5;i++)
for(j=0;j<4;j++)
a[i][j]=rand()%1000;
C语言(随机数种子)
最新推荐文章于 2023-11-14 23:20:47 发布
//注意:这两个头文件不可以缺少
#include<ctime>
#include<cstdlib>
srand((unsigned)time(NULL));
for(i=0;i<5;i++)
for(j=0;j<4;j++)
a[i][j]=rand()%1000;