Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- bool isfound(vector<string> v, string s) {
- for (size_t i = 0; i < v.size(); i++) {
- if (v[i] == s) {
- return true;
- }
- }
- return false;
- }
- int main() {
- int n;
- cin >> n;
- vector<string> names;
- string name;
- for (int i = 0; i < n; i++) {
- cin >> name;
- if (!isfound(names, name)) {
- names.push_back(name);
- }
- }
- for (auto& name : names) {
- cout << name << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement