main.cpp 335 B

12345678910111213141516171819
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. cout << "Hello ! Welcome in the word inversor ! :-D" << endl << "Enter a word :";
  6. string mot;
  7. getline(cin,mot);
  8. string tom;
  9. while (mot.size()!=0)
  10. {
  11. tom += mot[mot.size()-1];
  12. mot.erase(mot.size()-1);
  13. }
  14. cout << tom;
  15. return 0;
  16. }