Closed oiu850714 closed 4 years ago
這題用 vector 應該比 list 好? 將固定數目的單字 push_back 到 vector 後再對 vector sort 即可達成需求
审题:
inserting them in the container alphabetically as they are entered
要求插入时就维持字母序,而并非全部插入后再排序。
再说了,std::list 不能 sort 吗?
抱歉沒看清楚題目...
不過 std::list 只能用 std::sort::list,且這是在第十章才說明的
這題用 vector 應該比 list 好? 將固定數目的單字 push_back 到 vector 後再對 vector sort 即可達成需求