Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main()
- {
- std::string str;
- std::getline(std::cin, str, '!');
- if (!str.empty())
- {
- if (str.find("noon") != std::string::npos)
- std::cout << "Found\n";
- else
- std::cout << "Not found\n";
- }
- else
- std::cout << "String shouldn\'t start with \'!\' character\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment