随机数生成函数

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6     //srand((unsigned)time(NULL));
 7     srand(int(time(0)));
 8     for(int i = 0;i < 10;i++)
 9     {
10         cout << rand() << "\t";
11     }
12     return 0;
13 }

 

posted @ 2019-09-23 17:03  ChunhaoMo  阅读(403)  评论(0编辑  收藏  举报