Answer:
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
int numElements;
std::cin >> numElements;
std::vector<std::string> aprTopPicks(numElements);
for (int i = 0; i < numElements; i++) {
std::cin >> aprTopPicks[i];
}
std::vector<std::string> novTopPicks(numElements);
for (int i = 0; i < numElements; i++) {
std::cin >> novTopPicks[i];
}
if (aprTopPicks == novTopPicks) {
std::cout << "November's top picks are the same as April's top picks." << std::endl;
} else {
std::cout << "November's top picks are not the same as April's top picks." << std::endl;
}
std::vector<std::string> novBackup(numElements);
std::copy(novTopPicks.begin(), novTopPicks.end(), novBackup.begin());
std::cout << "April's top picks: ";
for (int i = 0; i < numElements; i++) {
std::cout << aprTopPicks[i] << " ";
}
std::cout << std::endl;
std::cout << "November's top picks: ";
for (int i = 0; i < numElements; i++) {
std::cout << novTopPicks[i] << " ";
}
std::cout << std::endl;
std::cout << "November's top picks are ";
if (aprTopPicks == novTopPicks) {
std::cout << "the same as ";
} else {
std::cout << "not the same as ";
}
std::cout << "April's top picks." << std::endl;
std::cout << "November's backup: ";
for (int i = 0; i < numElements; i++) {
std::cout << novBackup[i] << " ";
}
std::cout << std::endl;
return 0;
}
Step-by-step explanation: