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;
- char symbol;
- cout << "Enter symbol: " << endl;
- cin >> symbol;
- cin.ignore(100, '\n');
- cout << "Enter text: " << endl;
- getline(cin, text);
- stringstream words(text);
- while (words >> word)
- {
- if (word.find(symbol) != string::npos)
- {
- cout << word << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement