samedi 28 mars 2015

Reverse characters of each words in vector string


vector <string> theWords;
theWords.reserve(100);

istream_iterator <string> stringReader(cin);
istream_iterator <string> stringReaderEOF;

while(stringReader != stringReaderEOF)
theWords.push_back(* stringReader++);

display(theWords);
//reverse(theWords);


INPUT:


samin khan


OUTPUT:


samin


khan


After reversing:


nimas


nahk


How do I reverse the characters?


Aucun commentaire:

Enregistrer un commentaire