Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string.h>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. string search("problem");
  10. string line;
  11. int lineNumber = 0;
  12.  
  13. //cout << "enter a sentence :\n>" << search << endl;
  14. while (getline(cin, line, '\n')) {
  15. lineNumber++;
  16. transform(line.begin(), line.end(), line.begin(), ::tolower);
  17. if (lineNumber > 1000){
  18. break;
  19. }
  20. if(line.length() >80){
  21. break;
  22. }
  23.  
  24.  
  25. if (line.find(search) != std::string::npos) {
  26. cout << "yes" << endl;
  27. }else {
  28. cout << "no" << endl;
  29. }
  30.  
  31. }
  32. return 0;
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement