C/C++ 生成隨機數

/* 經過系統時間,生成真正的隨機數 */ #include<cstdio> #include<time.h> #include<stdlib.h> int main(){ int range = 100; // 指定隨機數範圍,本代碼100之內 const int number = 10; // 數組長度 int arry[number]; srand((int)time(0));/
相關文章
相關標籤/搜索