Guest User

Untitled

a guest
May 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main(void)
  7. {
  8. string skirt = " .,!?:;()\t";
  9. string s("ghj lapas as");
  10. string eil("lapas");
  11. int a = s.find(eil);
  12. string b = s.substr(a-1, eil.length()+2);
  13. if(b.find_first_of(skirt, 0) == 0 && b.find_first_of(skirt, eil.length()+1) == eil.length()+1)
  14. {
  15. cout << s.substr(a, eil.length()) << endl;
  16. }
  17. system ("pause");
  18. }
Add Comment
Please, Sign In to add comment