{{{~cpp #include #include #include #include #include using namespace std; struct student{string name; int score;}; bool compare(student a, student b); bool compare2(student a, student b); void main() { student st[5]; st[0].name = "nj"; st[0].score = 76; st[1].name = "jk"; st[1].score = 66; st[2].name = "hj"; st[2].score = 78; st[3].name = "gh"; st[3].score = 73; vector sp; sp.push_back(st[1]); sp.push_back(st[2]); sp.push_back(st[3]); sp.push_back(st[4]); sort(sp.begin(), sp.end(), compare); for(vector::iterator i= sp.begin();i!=sp.end(); i++) cout << i->name <<"\t"<< i->score << endl; cout << "-------------------------------------"<name<<"\t"<score<< endl; } bool compare(student a, student b); { return a.name < b.name; } bool compare2(student a, student b); { return a.score < b.score; } }}} 자다가..배꼈는데..에러가있다..난감하다.. ---- [STL실습], [데블스캠프2004/목요일]