티스토리 뷰
#include#include #include using namespace std; // plain random number generating routine int main() { srand((unsigned)time(NULL)); // seeding cout << RAND_MAX << endl; double bucket_sz = RAND_MAX/7; // To get d{0-6} cout << bucket_sz << endl; int num, ran; for(int i=0 ; i<1000 ; i++) { ran = rand(); num = (int)(rand()/bucket_sz); cout << "rand: " << ran << ", num: "; cout << num << endl; } system("pause"); return 0; }
'C & C++ > Native C++' 카테고리의 다른 글
잊지 말아야 할 당연한 것들 (0) | 2009.09.07 |
---|---|
포인터, 레퍼런스 가지고 장난치기 (0) | 2009.07.26 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- structure
- how to solve it
- TCGA
- QT
- Visual C++
- PyQt
- QPrinter.Letter
- ctypes
- GSX 1000 pro
- cython
- pandas
- 볼륨 낮춤
- GSX 1200 pro
- TensorBoard
- C++
- 볼륨 조절
- Item 9
- 설치
- QPrinter.A4
- CanDrA
- dll
- Accelerated C++
- tensorflow
- volume dial
- destructor
- 이상한 문자
- MSVC++
- armadillo c++
- Python
- matrix multiplication
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함