mardi 19 janvier 2021

C++

After compilation, the program always returns the same results. Unpredictably, code work coretly on linux ...

    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> distribut(1, 6);

    for (int i=0; i < 10; i++)
    {
        std::cout << distribut(gen) << ' ';
    }

Compiler specification:

❯ g++ --version
g++.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Aucun commentaire:

Enregistrer un commentaire