#include <iostream> #include <stack> #include <string.h> using namespace std; int main() { char x[300]; while (cin >> x) {//一定会覆盖原来的.不用重新初始化 stack<char> zifu; int len = strlen(x); for (int i = 0; i < len; i++) { zifu.push(x[i]); } while (!zifu.empty()) { cout << zifu.top(); zifu.pop(); } } return 0; }