Added previous arduino implementations.

This commit is contained in:
2026-08-07 13:29:57 +02:00
commit 2eb04509db
9 changed files with 179 additions and 0 deletions

21
Problem1.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "Problem1.hpp"
Problem1::Problem1() {
input = 1000;
}
bool Problem1::Step() {
// add all factors of 3 under input
factor3 += 3;
if (factor3 < input) output += factor3;
// add all factors of 5 under input but skip factors of 3
factor5 += 5;
if (factor5 < input) {
factor5_tick++;
if (factor5_tick != 3) output += factor5;
else factor5_tick = 0;
}
return input < factor3 && input < factor5;
}