Day 1 solved

This commit is contained in:
2025-12-01 23:57:59 +02:00
parent 2b56a394ef
commit 36582f0833
5 changed files with 8318 additions and 0 deletions

4126
Day1/Question1/input Normal file

File diff suppressed because it is too large Load Diff

18
Day1/Question1/main.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include <cstdint>
#include <fstream>
#include <iostream>
#include <string>
int main() {
std::fstream inputFile("input");
std::string currentLine;
int16_t counter = 50, number = 0, password = 0;
while (std::getline(inputFile, currentLine)) {
number = std::stoi(currentLine.substr(1));
counter = (counter + ((currentLine[0] == 'L') * 2 - 1) * number) % 100;
password += counter == 0 ? 1 : 0;
}
std::cout << password << std::endl;
return 0;
}