Skip to content
Snippets Groups Projects
Commit 4f7d3cd4 authored by Evy Storozhenko's avatar Evy Storozhenko
Browse files

stylistic choices

parent 2d92ed40
No related branches found
No related tags found
No related merge requests found
...@@ -25,13 +25,12 @@ void part_a() { ...@@ -25,13 +25,12 @@ void part_a() {
void part_b() { void part_b() {
std::ifstream data("data.txt"); std::ifstream data("data.txt");
constexpr std::array<std::string_view, 9> numbers
= { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
std::string line; std::string line;
uint32_t sum = 0; uint32_t sum = 0;
static constexpr std::array<std::string_view, 9> numbers
= { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
while (std::getline(data, line)) { while (std::getline(data, line)) {
std::pair num_a { 0, line.size() }; std::pair num_a { 0, line.size() };
for (size_t index = 0; index < numbers.size(); ++index) { for (size_t index = 0; index < numbers.size(); ++index) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment