Add 2021 Day 1 solutions
This commit is contained in:
21
2018/puzzle-01-01.cc
Normal file
21
2018/puzzle-01-01.cc
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by Matthew Gretton-Dann on 01/12/2021.
|
||||
//
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using Int = std::int64_t;
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
Int value{0};
|
||||
std::string line;
|
||||
while (std::getline(std::cin, line)) {
|
||||
Int incr{std::stoll(line)};
|
||||
value += incr;
|
||||
}
|
||||
std::cout << "Frequency: " << value << '\n';
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user