Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(void)
- {
- string skirt = " .,!?:;()\t";
- string s("ghj lapas as");
- string eil("lapas");
- int a = s.find(eil);
- string b = s.substr(a-1, eil.length()+2);
- if(b.find_first_of(skirt, 0) == 0 && b.find_first_of(skirt, eil.length()+1) == eil.length()+1)
- {
- cout << s.substr(a, eil.length()) << endl;
- }
- system ("pause");
- }
Add Comment
Please, Sign In to add comment