#include <iostream>
#include <random>
#include <algorithm>
#include <vector>
template<class T1,class T2,std::size_t N>
bool Copy(T1(&Dest)[N], T2(&Src)[N]){
for (size_t i = 0; i < N; i++)
{
Dest[i] = Src[i];
}
return true;
}
int main(){
static const int N = 16;
char ArrayA[N] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int ArrayB[N];
std::random_device RD;
std::mt19937 mt(RD());
std::cout << "Start The Program"<< std::endl;
std::shuffle(ArrayA, ArrayA + N, mt);
Copy(ArrayB, ArrayA);
std::vector<int> ArrayC{ArrayB,ArrayB+N};
std::vector<int> ArrayD;
ArrayD = ArrayC;
for (size_t i = 0; i < N; i++)
{
if (ArrayA[i] != ArrayB[i]) std::cout << "Array Is MissMatch!!:" << i << std::endl;
if (ArrayB[i] != ArrayC[i]) std::cout << "Array Is MissMatch!!:" << i << std::endl;
if (ArrayC[i] != ArrayD[i]) std::cout << "Array Is MissMatch!!:" << i << std::endl;
}
std::cout << "End of Program"<< std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cmFuZG9tPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgoKdGVtcGxhdGU8Y2xhc3MgVDEsY2xhc3MgVDIsc3RkOjpzaXplX3QgTj4KYm9vbCBDb3B5KFQxKCZEZXN0KVtOXSwgVDIoJlNyYylbTl0pewoJZm9yIChzaXplX3QgaSA9IDA7IGkgPCBOOyBpKyspCgl7CgkJRGVzdFtpXSA9IFNyY1tpXTsKCX0KCglyZXR1cm4gdHJ1ZTsKfQoKaW50IG1haW4oKXsKCXN0YXRpYyBjb25zdCBpbnQgTiA9IDE2OwoJY2hhciBBcnJheUFbTl0gPSB7IDAsIDEsIDIsIDMsIDQsIDUsIDYsIDcsIDgsIDksIDEwLCAxMSwgMTIsIDEzLCAxNCwgMTUgfTsKCWludCBBcnJheUJbTl07CgoJc3RkOjpyYW5kb21fZGV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