aboutsummaryrefslogtreecommitdiff
path: root/src/2015/day24/aoc.cpp
blob: 81baeb8a24c30dd5c36df15cd71d29ecd13dab32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "aoc.h"
#include <vector>

namespace aoc2015 {

int get_number(const char* p) {
  int d{0};
  while(*p >= '0' && *p <= '9') {
    d = d * 10 + *p - '0';
    p++;
  }
  return d;
}

std::pair<int, int> day24(line_view file) {
  int total{0};
  per_line(file,[&total](line_view lv){
      total += get_number(lv.line);
      return true;
  });
  int sub = total / 3;
  return {total, 0};
}

}