Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main()
- {
- string text, word;
- string symbol;
- cout << "Enter symbol: " << endl;
- getline(cin, symbol);
- symbol.resize(1);//чтобы было больше функций
- cout << "Enter text: " << endl;
- getline(cin, text);
- stringstream words(text);
- while (words >> word)
- {
- bool flag = 0;
- for (int i = 0; i < word.length(); i++)//еще больше функций
- {
- if (word.find(symbol) != string::npos)
- {
- flag = 1;;
- }
- }
- if (flag)
- {
- cout << word << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement