Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <stack>
- using namespace std;
- int main() {
- string s;
- getline(cin, s);
- stack<char> chars;
- for (int i = 0; i < s.length(); i++) {
- chars.push(s[i]);
- }
- while (!chars.empty()) {
- cout << chars.top();
- chars.pop();
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement