#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

#define check( s, a, b ) { \
if( (a) != (b) ) { \
cout << "## FAIL (" << (s) << "): " << (a) << " != " << (b) << endl; \
} \
else { \
cout << "## PASS (" << (s) << "): " <<  (a) << endl; \
} \
}

class Student {
    string name;
    int score;
public:
    Student(string n, int s) : name(n), score(s) {};
    bool operator==(const Student &s) { return name==s.name && score==s.score; }
};

//***********
// 여기에 자신의 코드를 넣는다
// 이부분 외에는 수정하지 말 것
//***********
template <typename T>
class List{
private:
    vector<T> data;
public:
    List() { }
    
    void add(T item) {
        data.push_back(item);
    }
    
    int size() { return data.size(); }
    void clear() { data.clear(); }
    
    void display() {
        for(int i = 0; i < data.size(); ++i) {
            cout << data[i] << endl;
        }
    }
    bool exist(T item) {
        return (find( data.begin(), data.end(), item ) != data.end());
    }
};

int main()
{
    List<string> grocery;
    grocery.add("milk");
    grocery.add("eggs");
    grocery.add("bread");
    check("add()/size()", grocery.size(), 3 );
    grocery.display(); // 각 줄에 milk, eggs, bread가 출력됨 (세줄)
    grocery.clear();
    check("clear()", grocery.size(), 0 );
    
    List<Student> students;
    Student s1("Shin", 88);
    Student s2("Kim", 72);
    Student s3("Cho", 91);
    
    students.add( s1 );
    students.add( s2 );
    students.add( s3 );

    Student s4("Shin", 90);
    
    check("find()", students.exist( s4 ), false );
    check("find()", students.exist( s3 ), true );

    system("read");
    return 0;
}