#include <iostream>
#include <vector>
#include <time.h>
#include <random>
#include <algorithm>
thread_local std::mt19937 gen{ std::random_device{}() };
int main()
{
srand(time(NULL));
std::vector<int> pula(49);
std::iota(pula.begin(), pula.end(), 0);
std::vector<int> zaklad{ 4,11,17,28,35,47 };
uint64_t ilosctrafien{ 0 };
std::cout << std::fixed;
std::cout.precision(10);
for (uint64_t j = 0; j < 600000000; j++)
{
std::shuffle(pula.begin(), pula.end(), gen);
if (std::is_permutation(pula.begin(), pula.begin() + 6, zaklad.begin()))
{
ilosctrafien++;
std::cout << "Wygrana po raz " << ilosctrafien << " Percent: " << (double)j * 100.0 / 600000000.0 << " Success ratio:" << double(ilosctrafien) / (double)j << std::endl;
}
}
}
Gdy to skompiluję g++ (MinGW-64) w Windows, to za każdym odpaleniem programu mam te same wyniki. Gdy skompiluję to clangiem lub cl lub g++ w Linuxie - wyniki nie powtarzają się. Nie rozumiem tego.