Guest User

Untitled

a guest
Dec 7th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main()
  5. {
  6.     std::string str;
  7.     std::getline(std::cin, str, '!');
  8.  
  9.     if (!str.empty())
  10.     {
  11.         if (str.find("noon") != std::string::npos)
  12.             std::cout << "Found\n";
  13.         else
  14.             std::cout << "Not found\n";
  15.     }
  16.     else
  17.         std::cout << "String shouldn\'t start with \'!\' character\n";
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment