• Помогите написать программу с++, я не понимаю как искать одинаковые слова в строке

    question img

Ответы 1

  • #include <iostream> #include <string> #include <sstream> #include <unordered_set> using namespace std;   typedef unordered_set<string> my_set;   int main() {     string tmp, in = "hello world friend hello world hello";     my_set us;     stringstream ss;     ss << in;     while (ss >> tmp)  us.insert(tmp);     for (auto i : us) cout << i << " ";     system("pause"); }
    • Автор:

      madonna
    • 5 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years