{{{~cpp #include #include #include #include using namespace std; struct student { string name; int score; }; bool compare(student a, student b); bool compareName(student a, student b); void main() { vector vec; vector::iterator i; student a, b, c, d, e; a.name = "재화"; a.score = 100; b.name = "세환"; b.score = 40; c.name = "김군"; c.score = 30; d.name = "이군"; d.score = 20; e.name = "박양"; e.score = 50; //cout << a.score; vec.push_back(a); vec.push_back(b); vec.push_back(c); vec.push_back(d); vec.push_back(e); sort(vec.begin(), vec.end(), compare); for (i = vec.begin(); i < vec.end(); i++) cout << i->name << " " << i->score << endl; cout<<"------------------------------"<name << " " << i->score << endl; /*for(int i=0; i