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