From 3b9678982f745acf5f94f88ac6e4eb9cb824a806 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 1 Dec 2023 21:37:56 +0100 Subject: Aufräumen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- makefile | 5 +---- src/01b.cpp | 14 +------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/makefile b/makefile index 69242b1..3facda7 100644 --- a/makefile +++ b/makefile @@ -2,10 +2,7 @@ include config.mk all: bin/01a bin/01b -bin/01a: obj/01a.o | bin - c++ $(LDFLAGS) $^ -o $@ - -bin/01b: obj/01b.o | bin +bin/%: obj/%.o | bin c++ $(LDFLAGS) $^ -o $@ obj/%.o: src/%.cpp | obj 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 @@ #include using namespace std; -string -replace_all(string str, const string search, const string with) -{ - for ( ;; ) { - auto it = str.find(search); - if ( it == string::npos ) - break; - str.replace(it, search.length(), with); - } - return str; -} - int main() { @@ -45,7 +33,7 @@ main() fstream input{ "data/01a.txt" }; - int sum = 0; + auto sum = 0; for ( string line; input >> line; ) { string sub; vector digits; -- cgit v1.3