Explorar el Código

29.09.2026 added

villis hace 3 semanas
padre
commit
c382bff0ac
Se han modificado 2 ficheros con 31 adiciones y 0 borrados
  1. 25 0
      29.09.2026/var1/problem1.py
  2. 6 0
      29.09.2026/var1/problem2.py

+ 25 - 0
29.09.2026/var1/problem1.py

@@ -0,0 +1,25 @@
+import sys
+
+repo: list[int] = []
+damnnumbers: list[int] = []
+
+while True:
+    try:
+        repo = list(map(int, input().split()))
+    except EOFError:
+        break
+
+if len(repo) == 1:
+    print(*repo)
+    sys.exit(0)
+
+if repo:
+    for i in range(len(repo)):
+        if i == len(repo) - 1:
+            damnnumbers.append(repo[i - 1] + repo[0])
+            break
+        damnnumbers.append(
+            repo[i + 1] + repo[i - 1] if not i == 0 else repo[i + 1] + repo[-1]
+        )
+
+print(" ".join(str(n) for n in damnnumbers))

+ 6 - 0
29.09.2026/var1/problem2.py

@@ -0,0 +1,6 @@
+salary: list[int] = list(map(int, input().split()))
+
+min_salary = min(salary)
+max_salary = max(salary)
+
+print(max_salary - min_salary)