Update 2021 sources to pass clang-tidy

This commit is contained in:
2021-12-02 07:31:53 +00:00
parent 87d9b62240
commit 7ab7ecb00a
4 changed files with 16 additions and 15 deletions

View File

@@ -2,24 +2,25 @@
// Created by Matthew Gretton-Dann on 01/12/2021.
//
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
int main(void)
auto main() -> int
{
std::vector<unsigned long> nums;
std::vector<std::uint64_t> nums;
unsigned incrs{0};
std::string line;
while (std::getline(std::cin, line)) {
nums.push_back(std::stoul(line));
}
assert(nums.size() >= 3);
unsigned long prev{std::numeric_limits<unsigned long>::max()};
std::uint64_t prev{std::numeric_limits<std::uint64_t>::max()};
for (std::size_t pos = 0; pos <= nums.size() - 3; ++pos) {
unsigned long current{0};
std::uint64_t current{0};
for (std::size_t i = pos + 0; i < pos + 3; ++i) {
current += nums[i];
}