1#include <iostream>
2#include <string>
3#include <vector>
4
5using std::cout; using std::sort;
6using std::vector; using std::string;
7using std::endl;
8
9int main() {
10 vector<string> arr = { "raid", "implementation", "states", "all",
11 "the", "requirements", "parameter", "a",
12 "and", "or", "execution", "participate" };
13
14
15 for (const auto &item : arr) {
16 cout << item << "; ";
17 }
18 cout << endl;
19
20 sort(arr.begin(), arr.end());
21
22 for (const auto &item : arr) {
23 cout << item << "; ";
24 }
25 cout << endl;
26
27 exit(EXIT_SUCCESS);
28}
29
1++ cCopy#include <iostream>
2#include <string>
3#include <vector>
4
5using std::cout; using std::sort;
6using std::vector; using std::string;
7using std::endl;
8
9int main() {
10 vector<string> arr = { "raid", "implementation", "states", "all",
11 "the", "requirements", "parameter", "a",
12 "and", "or", "execution", "participate" };
13
14
15 for (const auto &item : arr) {
16 cout << item << "; ";
17 }
18 cout << endl;
19
20 sort(arr.begin(), arr.end());
21
22 for (const auto &item : arr) {
23 cout << item << "; ";
24 }
25 cout << endl;
26
27 exit(EXIT_SUCCESS);
28}
29