mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Partial day 06.
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include "days.hpp"
|
||||
|
||||
void aoc2019::day06_part1(std::istream &input, std::ostream &output) {
|
||||
std::string buffer;
|
||||
std::regex regex("^([A-Z0-9]+)\\)([A-Z0-9]+)$");
|
||||
|
||||
while (std::getline(input, buffer)) {
|
||||
std::smatch match_results;
|
||||
|
||||
if (!std::regex_match(buffer, match_results, regex)) {
|
||||
std::string error = "Invalid line: ";
|
||||
error += buffer;
|
||||
throw std::domain_error(error);
|
||||
}
|
||||
}
|
||||
output << "Not implemented\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user