From a1ab4d590facae9263cdbf97143c7eac7f5dbf25 Mon Sep 17 00:00:00 2001 From: ajet Date: Sat, 13 Dec 2025 19:14:05 -1000 Subject: [PATCH] remove bad using --- src/day2.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/day2.cpp b/src/day2.cpp index 784a348..d53d1e5 100644 --- a/src/day2.cpp +++ b/src/day2.cpp @@ -10,25 +10,23 @@ struct Data { int64_t max; }; -using std::cout, std::endl, std::vector, std::ifstream; - -int64_t part_1(const vector &); -int64_t part_2(const vector &); +int64_t part_1(const std::vector &); +int64_t part_2(const std::vector &); int main() { - ifstream file{"input/2025-2.txt"}; + std::ifstream file{"input/2025-2.txt"}; Data line; char throwaway; - vector v; + std::vector v; while (file >> line.min >> throwaway >> line.max) { v.push_back(line); file >> throwaway; } - cout << "Part 1: " << part_1(v) << endl; - cout << "Part 2: " << part_2(v) << endl; + std::cout << "Part 1: " << part_1(v) << std::endl; + std::cout << "Part 2: " << part_2(v) << std::endl; } -int64_t part_1(const vector &v) { +int64_t part_1(const std::vector &v) { int64_t answer{0}; for (auto d : v) { for (auto n{d.min}; n <= d.max; ++n) { @@ -61,7 +59,7 @@ int64_t solve_n(int64_t n) { return 0; } -int64_t part_2(const vector &v) { +int64_t part_2(const std::vector &v) { int64_t ans{0}; for (auto d : v) { for (auto n{d.min}; n <= d.max; ++n) {