fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <stack>
  4. using namespace std;
  5.  
  6. int main() {
  7. stack<char> s;
  8. string zbor;
  9. getline(cin, zbor);
  10. for(int i=0; i<zbor.size(); i++)
  11. s.push(zbor.at(i));
  12. while(!s.empty())
  13. {
  14. cout<<s.top();
  15. s.pop();
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 5296KB
stdin
filip
stdout
pilif