Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- int main() {
- std::vector<std::string> books;
- for (int i = 0; i < 3; ++i) {
- std::string name_book;
- std::getline(std::cin, name_book);
- books.push_back(name_book);
- }
- std::reverse(books.begin(), books.end());
- for (const auto& num_book : books) {
- std::cout << num_book << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment