Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sortline.cpp File Reference
#include <iostream>
#include <fstream>
#include <string>
#include <set>
Include dependency graph for sortline.cpp:

Go to the source code of this file.

Typedefs

typedef std::set< std::string > StrSet
 

Functions

int main ()
 

Typedef Documentation

◆ StrSet

typedef std::set<std::string> StrSet

Definition at line 6 of file sortline.cpp.

Function Documentation

◆ main()

int main ( void )

Definition at line 8 of file sortline.cpp.

9{
10 StrSet ss;
11 std::string line;
12 while (std::getline(std::cin, line)) {
13 if (!line.empty() && line[line.size() - 1] == '\n') {
14 line.resize(line.size() - 1);
15 }
16 if (!line.empty()) {
17 ss.insert(line);
18 }
19 }
20 for (StrSet::const_iterator i = ss.begin(), ie = ss.end(); i != ie; ++i) {
21 std::cout << *i << std::endl;
22 }
23}
static const Segment ss(Segment::ss)
std::set< std::string > StrSet
Definition sortline.cpp:6