fork(1) download
  1. #include <algorithm>
  2. #include <cassert>
  3. #include <iostream>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. srand(1234567890);
  10. vector<string> teams = {
  11. "Turkey", "Italy", "Wales", "Switzerland",
  12. "Denmark", "Finland", "Belgium", "Russia",
  13. "Netherlands", "Ukraine", "Austria", "North Macedonia",
  14. "England", "Croatia", "Scotland", "Czech Republic",
  15. "Spain", "Sweden", "Poland", "Slovakia",
  16. "Hungary", "Portugal", "France", "Germany"
  17. };
  18. random_shuffle(teams.begin(), teams.end());
  19. assert(teams.size() == 24);
  20. int winner = rand() % teams.size();
  21. cout << "The winner of EURO 2021: " << teams[winner] << endl;
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5416KB
stdin
Standard input is empty
stdout
The winner of EURO 2021: Belgium