aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-12-15 08:43:15 -0500
committerClyne Sullivan <clyne@bitgloo.com>2022-12-15 08:43:15 -0500
commit9044e949dc17fd23e2535a00246f25ea71817ade (patch)
tree5ad6935a93f2c79aee35f84615443291c0bc0382
parente54a0068c9fe99832a85cd459cd31f2b8967f45a (diff)
day15: really finish part 2 c++
-rw-r--r--day15/part2.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/day15/part2.cpp b/day15/part2.cpp
index 708f389..c8dd73e 100644
--- a/day15/part2.cpp
+++ b/day15/part2.cpp
@@ -34,14 +34,13 @@ bool isDistressBeacon(const Sensor& c)
int main()
{
- long px, py, bx, by;
-
std::string line;
std::getline(std::cin, line);
for (; !std::cin.eof(); std::getline(std::cin, line)) {
- auto a = sscanf(line.c_str(),
- "Sensor at x=%ld, y=%ld: closest beacon is at x=%ld, y=%ld",
- &px, &py, &bx, &by);
+ long px, py, bx, by;
+ sscanf(line.c_str(),
+ "Sensor at x=%ld, y=%ld: closest beacon is at x=%ld, y=%ld",
+ &px, &py, &bx, &by);
long power = std::abs(px - bx) + std::abs(py - by);
sensors.emplace_back(px, py, power);