Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- vector<string> nowy(vector<string>w, vector<string>n)
- {
- vector<string>nowy;
- for(unsigned int i = 0; i < w.size(); i++)
- {
- bool znaleziono = false;
- for(unsigned int j = 0; j < n.size(); j++)
- {
- if(w[i].find(n[j])!=string::npos)
- znaleziono=true;
- }
- if(znaleziono==false)
- nowy.push_back(w[i]);
- }
- return nowy;
- }
- int main()
- {
- vector<string>w;
- vector<string>n;
- w.push_back("Wiadomosc 1");
- w.push_back("Wiadomosc 2");
- w.push_back("wiadomosc, nie zdasz");
- w.push_back("Message 1");
- w.push_back("Message 2");
- n.push_back("nie");
- n.push_back("2");
- vector<string>nowyWektor=nowy(w,n);
- for(unsigned int i = 0; i < nowyWektor.size(); i++)
- {
- cout<<nowyWektor[i]<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement