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

23
6/ex1.py Normal file
View File

@@ -0,0 +1,23 @@
import numpy as np
LINES_NUM = 5
COLS_NUM = 1000
count = 0
probs = np.array([])
with open('input.txt', 'r') as file:
for line in file:
for num in line.split():
probs = np.append(probs, num)
probs = probs.reshape((LINES_NUM, COLS_NUM))
for col in probs.T:
if col[4] == '+':
count += int(col[0]) + int(col[1]) + int(col[2]) + int(col[3])
elif col[4] == '*':
count += int(col[0]) * int(col[1]) * int(col[2]) * int(col[3])
print(count)