#include <iostream>
#include <random>
#include <ctime>
#include <algorithm>
using namespace std;
int main()
{
string str1 = "1a2b3c4d5e6f7g8h9i";
string str2 = "republic of korea";
int data1[10] = { 1,2,3,4,5,6,7,8,9,10 };
srand(static_cast<unsigned int>(time(NULL)));//난수 초기화
random_shuffle(str1.begin(), str1.end());
random_shuffle(str2.begin(), str2.end());
//random_shuffle(처음인덱스,끝 인덱스)로 사용한다.
//배열의 이름은 0번인덱스와 같다.
//data1 ~ data1+4이면 0~3번인덱스까지 해당한다.
random_shuffle(data1,data1+4);
//실행결과는 할때마다 바뀔것이다.
cout << "== str1 ==" << endl;
//for(element : array): element = 선언된 변수에 배열요소를 할당.
// array = 반복할 배열
for (auto i : str1)
cout << i << ", ";
cout << endl << "== str2 ==" << endl;
for (auto i : str2)
cout << i << ", ";
cout << endl << "== data1 ==" << endl;
for (auto i : data1)
cout << i << ", ";
return 0;
}