Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <string>
- #include <vector>
- using namespace std;
- int main() {
- string request;
- getline(cin, request);
- vector<string> text;
- string str;
- while (getline(cin, str)) {
- text.push_back(str);
- }
- if (request.find("--tac") != request.npos) {
- reverse(text.begin(), text.end());
- }
- if (request.find("--rev") != request.npos) {
- for (string& s : text) {
- reverse(s.begin(), s.end());
- }
- }
- for (string s : text) {
- cout << s << endl;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment