随机数生成函数

 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 }

猜你喜欢

转载自www.cnblogs.com/mch5201314/p/11573357.html