#include <iostream> #include <string> using namespace std; // 默认输入合法 int main(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); std::setvbuf(stdout, nullptr, _IOFBF, BUFSIZ); string str; cin>>str; //reverse(str.begin(),str.end()); const auto end = str.crend(); auto begin = str.crbegin(); while (begin != end) { cout<<*begin; begin++; } //cout<<str; return 0; }