Euler 1-5

This commit is contained in:
Jos van Goor 2022-12-01 16:45:37 +01:00
parent 9cf858b860
commit 68a75987e2
6 changed files with 161 additions and 0 deletions

15
project_euler/problem1.cc Normal file
View file

@ -0,0 +1,15 @@
#include <cstdint>
#include <fmt/format.h>
int main()
{
std::int64_t result = 0;
for (std::int64_t value = 3; value < 1000; value += 3)
result += value;
for (std::int64_t value = 5; value < 1000; value += 5)
result += value % 3 == 0 ? 0 : value;
fmt::print("Result: {}\n", result);
}