summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/srcut.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/srcut.cpp b/src/srcut.cpp
new file mode 100644
index 0000000..194cc65
--- /dev/null
+++ b/src/srcut.cpp
@@ -0,0 +1,34 @@
1#include <fstream>
2#include <iostream>
3#include <string>
4
5using namespace std;
6
7static void
8process(istream& in, ostream& os)
9{
10 auto match_begin = [](string_view s) -> bool {
11 return s.empty();
12 };
13
14 auto match_end = [](string_view s) -> bool {
15 return s.empty();
16 };
17
18 for ( string line; getline(in, line); ) {
19 if ( match_begin(line) ) {
20 }
21 else if ( match_end(line) ) {
22 }
23 else {
24 os << line << '\n';
25 }
26 }
27 os << flush;
28}
29
30int
31main(void)
32{
33 process(cin);
34}