0

how to place words of row in alphabetical order? C++

May be there are any special functions ?

27th Feb 2020, 10:11 AM
Anastasiia Kudria
Anastasiia Kudria - avatar
3 Respostas
+ 2
Split the string/sentence into words by using space as delimiter, and then store the words into a vector of string. Sort the vector. Join the string vector using space. #include <sstream> Use std::stringstream to split and join string. #include <algorithm> Use std::sort to sort order in vector.
27th Feb 2020, 10:44 AM
Ipang
+ 1
Words of row? Show me the code?
27th Feb 2020, 10:13 AM
Ipang
+ 1
I don't have a code. I don't understand how to do it. For example: "The weather is sunny today" I need to place words in alphabetical order. I have written var for string and alphabet
27th Feb 2020, 10:32 AM
Anastasiia Kudria
Anastasiia Kudria - avatar