Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 51 trang
Thông tin tài liệu
Standard Template Library (STL library) Now consider taking the form of Intset.cpp and reshaping it to display a list of the words used in a document The solution becomes remarkably simple //: C04:WordSet.cpp #include " /require.h" #include #include #include #include using namespace std; int main(int argc, char* argv[]) { requireArgs(argc, 1); ifstream source(argv[1]); assure(source, argv[1]); string word; set words; while(source >> word) words.insert(word); copy(words.begin(), words.end(), ostream_iterator(cout, "\n")); cout