Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
shuffle_example
#include <iostream> #include <algorithm> #include <vector> #include <random> #include <chrono> int main() { std::vector<int> shuffleme {0,1,2,3,4,5,6,7,8,9}; // get a time based seed unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); // shuffle the vector with the seed obtained std::shuffle(shuffleme.begin(), shuffleme.end(), std::default_random_engine(seed)); std::cout << "Shuffled elements are : "; // iterate through the vector and print the elements for(auto element : shuffleme) { std::cout << element << " "; } return 0; }
run
|
edit
|
history
|
help
0
MACRO
static_cast makes a copy
Splitwise Problem - 1
PriorQ
test
HeapSort
protected
ignat
Find Case Combinations of a String
Proga1