C++?????????÷???
???????????? ???????[ 2014/10/28 11:31:04 ] ????????C++ ???????
????C++?е?????<cstdlib>????????<iostream>?У???????????????α????????????rand??????srand??????
???????????int rand??void????
??????srand??seed???????seed?????????????Χ????[seed??RAND_MAX??0x7fff?????????????
????????????void srand??unsigned seed????
???????seed??rand?????????????????????????rand????????????
???????????rand?????????????????????srand???????????????rand???????????ù?srand?????????seed??????????????rand ??????seed??????????α???????????????????????rand???????е??ù?srand?????????rand?????????????????srand ??1????????????1???α????????????
???????????????????????rand????????γ????????????????????????????srand??seed???е????seed?????????????????????????? ???????????????????????????????????????????????seed????????????????????γ?????е????rand???????????????????????????? ?????????[seed??RAND_MAX??0x7fff??????Χ?е??????????????
??????????????????£?????????????0~6?????????????????6???????
?????????????????seed???????
????for??int i=0??i<10??i++??
????{
????ran_num=rand????%6??
????cout<<ran_num<<“ ”??
????}
?????????г?????????????5 5 4 4 5 4 0 0 4 2
??????????????seed?1????
????srand??1????
????for??int i=0??i<10??i++??
????{
????ran_num=rand????%6??
????cout<<ran_num<<“ ”??
????}
?????????г?????????????5 5 4 4 5 4 0 0 4 2????????????????????
???????????????seed????6????
????srand??6????
????for??int i=0??i<10??i++??
????{
????ran_num=rand????%6??
????cout<<ran_num<<“ ”??
????}
?????????г??????????????4 1 5 1 4 3 4 4 2 2???????????????????????????????????????????
??????????????seed?????????????????????λ???time_t time??0????????
????#include<ctime>
????……
????srand????unsigned??time??0??????
????for??int i=0??i<10??i++??
????{
????ran_num=rand????%6??
????cout<<ran_num<<“ ”??
????}
??????г???????????????????0 1 5 4 5 0 2 3 4 2????????????3 2 3 0 3 5 5 2 2 3??... ...??ε???н?????????????????????????????????????
????????time_t time??0??
????time_t ???????????????????????1970??1??1??????????????????????????????λ????????? cout<<time(0) ??????????1169174701???????37????* 365????* 24??С???* 3600???????o?????????
????????ran_num=rand????%6
??????rand????????????6????????????????????????????????[0??6??????????????????????????????? ??RAND_MAX????32767??????????????????????[a??b???????????????????rand????%??b-a????+ a????????? a ?????? b ??
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????