c++ 랜덤 코드!
https://learn.microsoft.com/ko-kr/cpp/standard-library/random?view=msvc-170
<random>
자세한 정보:
learn.microsoft.com
#include <iostream>
#include <random>
using namespace std;
int main()
{
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<int> distribution(0, 10); // 0 ~ 10
for (int i = 0; i < 10; ++i)
{
cout << distribution(gen) << endl;
}
}
'기타 > C++' 카테고리의 다른 글
[C++] 함수 포인터 (delegate) (0) | 2022.06.05 |
---|---|
[C++] 공개키 암호화 방식 구현해보기 (RSA) (0) | 2022.03.19 |
[C++] GCD (Greatest Common Divisor) 최대 공약수 (0) | 2022.03.18 |
[C++] ctime clock을 이용한 경과 시간 (성능 측정) (0) | 2022.03.18 |
[C++] Console 소코반 게임 소스 (0) | 2022.02.07 |