Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. 1 #include <iostream>
  2. 2 #include <string>
  3. 3 #include <algorithm>
  4. 4 #include <vector>
  5. 5
  6. 6 const string NAMES [] = {"Gary", "Shannon", "Lisa"};
  7. 7
  8. 8 int main()
  9. 9 {
  10. 10 // take 12 choices
  11. 11 cout << "Welcome to the Advent Calendar!" << endl;
  12. 12
  13. 13 vector<string> advent_list;
  14. 14 vector<string>::iterator i;
  15. 15
  16. 16 // put names in a list
  17. 17 int count;
  18. 18 for (count = 0; count < 12; count++
  19. 19 advent_list.push_back(NAMES[count % 3]);
  20. 20
  21. 21 //randomize, print out giving list
  22. 22 cout << "giving:" << endl;
  23. 23 random_shuffle(advent_list.begin(), advent_list.end());
  24. 24 for (i = advent_list.begin(); i != adven_list.end(); ++1)
  25. 25 cout << *i << endl;
  26. 26
  27. 27 //randomize, print out reciving list
  28. 28 cout <<"recieving:" <<endl;
  29. 29 random_shuffle(i = advent_list.begn(), i !=advent_list.end());
  30. 30 for (i = advent_list.begin(); i != advent_list.end(); ++1)
  31. 31 cout <<*i <<endl;
  32. 32
  33. 33 return 0;
  34. 34 }
  35.  
  36.  
  37. main.cpp:6: error: ‘string’ does not name a type
  38. main.cpp: In function ‘int main()’:
  39. main.cpp:11: error: ‘cout’ was not declared in this scope
  40. main.cpp:11: error: ‘endl’ was not declared in this scope
  41. main.cpp:13: error: ‘vector’ was not declared in this scope
  42. main.cpp:13: error: ‘string’ was not declared in this scope
  43. main.cpp:13: error: ‘advent_list’ was not declared in this scope
  44. main.cpp:14: error: ‘::iterator’ has not been declared
  45. main.cpp:14: error: expected `;' before ‘i’
  46. main.cpp:19: error: expected `)' before ‘advent_list’
  47. main.cpp:19: error: ‘NAMES’ was not declared in this scope
  48. main.cpp:23: error: ‘random_shuffle’ was not declared in this scope
  49. main.cpp:24: error: ‘i’ was not declared in this scope
  50. main.cpp:24: error: ‘adven_list’ was not declared in this scope
  51. main.cpp:24: error: lvalue required as increment operand
  52. main.cpp:30: error: lvalue required as increment operand
Add Comment
Please, Sign In to add comment