Answer:
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
bool sorter(string a, string b)
{
return a<b;
}
int main(){
string wordList[3];
string word;
for (int i = 0; i < 3; i++){
cout<< "Enter word: ";
cin>> word;
wordList[i] = word;
}
sort(wordList, wordList+3, sorter);
for (int i = 0; i < 3; i++){
cout<< wordList[i]<< "\\";
}
}
Step-by-step explanation:
The C++ source code prompts the user for string words that are appended to the wordList array. The array is sorted with the sort() function from the C++ bits library. The finally for loop statement prints out the items in the array.