#include #include #include #include using namespace std; vector SplitIntoWords(const string& s) { vector result; std::istringstream iss(s); string pice; while (std::getline(iss, pice, ' ')) { result.push_back(pice); } return result; } int main() { string s = "C Cpp Java Python"; vector words = SplitIntoWords(s); cout << words.size() << " "; for (auto it = begin(words); it != end(words); ++it) { if (it != begin(words)) { cout << "/"; } cout << *it; } cout << endl; system("pause"); return 0; }