this time with no legal info

This commit is contained in:
2025-12-08 01:11:02 +00:00
commit 2f38ac9096
29 changed files with 72807 additions and 0 deletions

BIN
1/count Executable file

Binary file not shown.

25
1/count.c Normal file
View File

@@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *file;
int count = 0;
int num = 50, add;
char rot;
file = fopen("input.txt", "r");
if (file == NULL) {
perror("Error opening file");
return 1;
}
while (fscanf(file, "%c%d\n", &rot, &add) == 2) {
num += (rot == 'R') ? add : -add;
num %= 100;
if (num < 0)
num += 100;
count += num ? 0 : 1;
}
fclose(file);
printf("Password: %d\n", count);
return 0;
}

BIN
1/count2 Executable file

Binary file not shown.

35
1/count2.c Normal file
View File

@@ -0,0 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *file;
int count = 0;
int num = 50, add;
char rot;
file = fopen("input.txt", "r");
if (file == NULL) {
perror("Error opening file");
return 1;
}
while (fscanf(file, " %c%d", &rot, &add) == 2) {
if (rot == 'R') {
count += (num + add) / 100;
num = (num + add) % 100;
} else if (rot == 'L') {
if (num == 0) {
count += add / 100;
} else if (add < num) {
// No wrap-around
} else {
count += ((add - num) / 100) + 1;
}
num = (num - add) % 100;
if (num < 0)
num += 100;
}
}
fclose(file);
printf("Password: %d\n", count);
return 0;
}

4487
1/input.txt Normal file

File diff suppressed because it is too large Load Diff

4487
1/inputtest.txt Normal file

File diff suppressed because it is too large Load Diff

BIN
1/test Executable file

Binary file not shown.

7
1/test.c Normal file
View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("%d\n", -101 % 100);
return 0;
}