Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <random>
- #include <iostream>
- int main() {
- #if ( _WIN32 || __WIN32__ || _WIN64 || __WIN64__ )
- srand(time(nullptr));
- std::mt19937 gen(rand());
- #else
- std::random_device rd;
- std::mt19937 gen(rd());
- #endif
- std::uniform_real_distribution<> dis(0, 1);
- for (int n = 0; n < 10; ++n) {
- std::cout << dis(gen) << ' ';
- }
- std::cout << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement