home *** CD-ROM | disk | FTP | other *** search
- #include <LEDA/set.h>
-
- declare(set,string)
-
- void print(set(string) S, string s)
- { cout << s;
- forall(s,S) cout << s << " ";
- newline;
- newline;
- S.clear();
- }
-
- main()
- {
-
- set(string) S, S1;
-
-
- string s;
-
- while (cin >> s)
- { if (s == "stop") break;
- S.insert(s);
- }
-
- S1 = S;
-
- print(S, "S = ");
- print(S1,"S1 = ");
-
- while (cin >> s)
- if (S1.member(s))
- { cout << "delete " << s << "\n";
- S1.del(s);
- }
- else cout << s << " not in S1 \n";
-
-
- print(S, "S = ");
- print(S1,"S1 = ");
-
-
- }
-
-