wordlist.cpp

来自「编程珠虮随书源码,非常好的软件工程学习思想.」· C++ 代码 · 共 21 行

CPP
21
字号
/* Copyright (C) 1999 Lucent Technologies */
/* From 'Programming Pearls' by Jon Bentley */

/* wordlist.cpp -- Sorted list of words (between white space) in file */#include <iostream>#include <set>
#include <string>using namespace std;int main(){	set<string> S;	string t; 	set<string>::iterator j;
	while (cin >> t)		S.insert(t);	for (j = S.begin(); j != S.end(); ++j)		cout << *j << "\n";
	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?