This repository has been archived on 2024-08-23. You can view files and clone it, but cannot push or open issues or pull requests.
lessons/C++/lesson4/task6.cpp
2023-07-16 13:23:25 +00:00

16 lines
261 B
C++

#include <iostream>
#include <string>
int main() {
std::string s;
std::string r;
std::getline(std::cin, s);
r.reserve(s.length());
for (int i = s.length() - 1; i >= 0; i--) {
r.push_back(s[i]);
}
std::cout << r << '\n';
}