diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-09-29 16:43:33 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-09-29 16:43:33 +0200 |
| commit | f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1 (patch) | |
| tree | 94581241ed6a8dc804c0b846ce65b45b25edac83 /src/srcut.cpp | |
| download | scissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.tar.gz scissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.tar.bz2 scissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.zip | |
erster checkin
Diffstat (limited to 'src/srcut.cpp')
| -rw-r--r-- | src/srcut.cpp | 34 |
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 | |||
| 5 | using namespace std; | ||
| 6 | |||
| 7 | static void | ||
| 8 | process(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 | |||
| 30 | int | ||
| 31 | main(void) | ||
| 32 | { | ||
| 33 | process(cin); | ||
| 34 | } | ||
