第一點,搭建完boost庫的環境
第二點用g++編譯的時候一定要帶上-I.
g++ boost_01.cpp -o a.out -I.
要取得[a,b)的隨機整數,使用(rand() % (b-a))+ a; 要取得[a,b]的隨機整數,使用(rand() % (b-a+1))+ a; 要取得(a,b]的隨機整數,使用(rand() % (b-a))+ a + 1; 通用