ordenar string cpp

Solutions on MaxInterview for ordenar string cpp by the best coders in the world

showing results for - "ordenar string cpp"
Lucy
28 Jan 2017
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
Valentine
26 Jul 2016
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
queries leading to this page
ordenar string cppordenar string cpp