Answers for "ordenar string cpp"

C++
1

ordenar string cpp

#include <iostream>
#include <string>
#include <vector>

using std::cout; using std::sort;
using std::vector; using std::string;
using std::endl;

int main() {
    vector<string> arr = { "raid", "implementation", "states", "all",
                           "the", "requirements", "parameter", "a",
                           "and", "or", "execution", "participate" };


    for (const auto &item : arr) {
        cout << item << "; ";
    }
    cout << endl;

    sort(arr.begin(), arr.end());

    for (const auto &item : arr) {
        cout << item << "; ";
    }
    cout << endl;

    exit(EXIT_SUCCESS);
}
Posted by: Guest on September-09-2021
0

ordenar string cpp

++ cCopy#include <iostream>
#include <string>
#include <vector>

using std::cout; using std::sort;
using std::vector; using std::string;
using std::endl;

int main() {
    vector<string> arr = { "raid", "implementation", "states", "all",
                           "the", "requirements", "parameter", "a",
                           "and", "or", "execution", "participate" };


    for (const auto &item : arr) {
        cout << item << "; ";
    }
    cout << endl;

    sort(arr.begin(), arr.end());

    for (const auto &item : arr) {
        cout << item << "; ";
    }
    cout << endl;

    exit(EXIT_SUCCESS);
}
Posted by: Guest on September-09-2021

Browse Popular Code Answers by Language