I wrote this code to basically shuffle a vector and I'm getting this error, and I'm not sure what's wrong. I have included algorithm. Thank you!
// Shuffle the vector
random_shuffle(names.begin(), names.end(), rand());
// Prelims
cout << "ROUND PRELIMINATION: BEGIN" << endl;
cout << names[32] << " versus " << names[29] << endl << "Please enter the winner: ";
cin >> winner;
round1.push_back(winner);
cout << endl << names[33] << " versus " << names[30] << endl << "Please enter the winner: ";
cin >> winner;
round1.push_back(winner);
cout << endl << names[34] << " versus " << names[31] << endl << "Please enter the winner: ";
cin >> winner;
round1.push_back(winner);
for (int i = 0; i < 29; i++) {
round1.push_back(names[i]);
}
Aucun commentaire:
Enregistrer un commentaire