Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <algorithm>
- #include <numeric>
- #include <mem.h>
- using namespace std;
- //char* del_in_str(char* a, char* b)
- //{
- // char * At=0;
- // char * Nt=0;
- // for (char * Bt=b; *Bt; Bt++)
- // {
- //
- // if (_Pred(At))
- // *Nt++=*At;
- // *Nt='\0';
- // }
- //
- // return a;
- //}
- inline double sqrt(double a){return a * a;}
- class erase_in
- {
- string str;
- public:
- erase_in(const string &_str) : str(_str) {}
- bool operator () (const char &obj)
- {
- bool xxx = str.find(obj) != string::npos;
- return xxx;
- }
- };
- string& del_in_string(string &a, string &b)
- {
- string::iterator I = remove_if(a.begin(), a.end(), erase_in(b));
- char mmm = *I;
- a.erase(I, a.end());
- return a;
- }
- int main()
- {
- char St[] = "в лесу";
- char Qt[] = " с";
- string Str1 = "abcdefg";
- string Str2 = "b";
- // char* Resolt = del_in_str(St, Qt);
- string ResUlt = del_in_string(Str1, Str2);
- // cout << "abcdefg\n\n";
- // cout << Resolt << " -resolt\n";
- cout << ResUlt;//" -resUlt\n";
- cin.get();
- // system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement