C++ 实现随机数的生成

C++随机数的实现方法十分简单,只须要使用一个函数便可 #include<iostream> using namespace std; int main(){ double y; srand((unsigned)time(NULL)); y = rand() ; cout << y << endl; return 0; } 注意这里要使用ios srand((unsigned)ti
相关文章
相关标签/搜索