2013年9月18日
摘要: 当我们要生成一个简单的随机数时,具体代码如下: 1 //生成0-10之间的随机数,可生成任意数之间的随机数 2 #inlcude 3 #include 4 #include 5 6 using namespace std; 7 8 int main() 9 {10 int tim; 11 srand(time(0));12 tim = rand()%10 + 1; //rand from 1-10,if you want to rand from N to M(M>N) ,do as :t... 阅读全文
posted @ 2013-09-18 11:22 水目沾 阅读(1168) 评论(0) 推荐(0) 编辑