1 #include2 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 }
本文共 291 字,大约阅读时间需要 1 分钟。
1 #include2 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 }
转载于:https://www.cnblogs.com/mch5201314/p/11573357.html