diff options
| author | Thomas Schmucker <ts@its1.de> | 2023-12-01 21:37:56 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2023-12-01 21:37:56 +0100 |
| commit | 3b9678982f745acf5f94f88ac6e4eb9cb824a806 (patch) | |
| tree | 404cc1afc8d9dc5ec190624c7c71321c658ca928 /src | |
| parent | 9a164c3f65c01e31a9d1a8578e29b358972ddfed (diff) | |
| download | advent-of-code-3b9678982f745acf5f94f88ac6e4eb9cb824a806.tar.gz advent-of-code-3b9678982f745acf5f94f88ac6e4eb9cb824a806.tar.bz2 advent-of-code-3b9678982f745acf5f94f88ac6e4eb9cb824a806.zip | |
Aufräumen
Diffstat (limited to 'src')
| -rw-r--r-- | src/01b.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/01b.cpp b/src/01b.cpp index f87da3a..91ba7b7 100644 --- a/src/01b.cpp +++ b/src/01b.cpp | |||
| @@ -6,18 +6,6 @@ | |||
| 6 | #include <vector> | 6 | #include <vector> |
| 7 | using namespace std; | 7 | using namespace std; |
| 8 | 8 | ||
| 9 | string | ||
| 10 | replace_all(string str, const string search, const string with) | ||
| 11 | { | ||
| 12 | for ( ;; ) { | ||
| 13 | auto it = str.find(search); | ||
| 14 | if ( it == string::npos ) | ||
| 15 | break; | ||
| 16 | str.replace(it, search.length(), with); | ||
| 17 | } | ||
| 18 | return str; | ||
| 19 | } | ||
| 20 | |||
| 21 | int | 9 | int |
| 22 | main() | 10 | main() |
| 23 | { | 11 | { |
| @@ -45,7 +33,7 @@ main() | |||
| 45 | 33 | ||
| 46 | fstream input{ "data/01a.txt" }; | 34 | fstream input{ "data/01a.txt" }; |
| 47 | 35 | ||
| 48 | int sum = 0; | 36 | auto sum = 0; |
| 49 | for ( string line; input >> line; ) { | 37 | for ( string line; input >> line; ) { |
| 50 | string sub; | 38 | string sub; |
| 51 | vector<int> digits; | 39 | vector<int> digits; |
