Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include <iostream>
- #include <algorithm>
- #include <string>
- int main()
- {
- std::vector<std::string> stringVector;
- stringVector.push_back("On");
- stringVector.push_back("se");
- stringVector.push_back("saatana");
- stringVector.push_back("tyomaa.");
- std::for_each(stringVector.begin(), stringVector.end(), [](std::string word)
- {
- std::string reversed = "";
- int stringLength = word.length();
- for (int i = stringLength - 1; i >= 0; i--)
- {
- reversed += word[i];
- }
- word = reversed;
- std::cout << word << std::endl;
- }
- );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement