Skip to content
Snippets Groups Projects
Commit 191b1bd1 authored by hacker717's avatar hacker717
Browse files

Коммит main в маи

parent 6b4210c4
No related branches found
No related tags found
No related merge requests found
2.4/3.py 0 → 100644
n = int(input())
a = 1
b = 1
arr = []
while True:
f = False
for _ in range(1, b + 1):
arr.append(a)
if a == n:
print(*arr)
f = True
break
a += 1
if f:
break
print(*arr)
arr = []
b += 1
\ No newline at end of file
print(sum([sum([int(i) for i in input()]) for _ in range(int(input()))]))
\ No newline at end of file
2.4/5.py 0 → 100644
c = 0
for _ in range(int(input())):
s = input()
arr = []
while s != "ВСЁ":
arr.append(s)
s = input()
if "зайка" in arr:
c += 1
print(c)
\ No newline at end of file
2.4/6.py 0 → 100644
arr = []
for _ in range(int(input())):
arr.append(int(input()))
if len(arr) <= 1:
continue
a, b = sorted(arr)
while a != b:
b, a = a, b - a
a, b = sorted([a, b])
arr = [a]
print(arr[0])
\ No newline at end of file
for i in range(int(input())):
for j in range(3 + i, 0, -1):
print(f"До старта {j} секунд(ы)")
print(f"Старт {i + 1}!!!")
\ No newline at end of file
arrs, arrn = [], []
for _ in range(int(input())):
arrs.append(input())
arrn.append(sum([int(i) for i in input()]))
print(arrs[len(arrs) - 1 - (arrn[::-1].index(max(arrn)))])
\ No newline at end of file
arr = []
for _ in range(int(input())):
arr.append(str(max([int(i) for i in input()])))
print("".join(arr))
\ No newline at end of file
3.1/1.py 0 → 100644
f = True
for i in range(int(input())):
s = input().lower()[0]
for sym in "абв":
if sym == s:
f = True
break
else:
f = False
if not f:
break
if f:
print("YES")
else:
print("NO")
\ No newline at end of file
string = ""
s = input()
while s != "ФИНИШ":
string += s
s = input()
string = string.lower().replace(" ", "")
d = {}
for i in string:
if i in d:
d[i] += 1
else:
d[i] = 1
maxl, s = 0, "я"
for i in d.keys():
if d[i] > maxl:
maxl = d[i]
s = i
elif d[i] == maxl:
if ord(i) < ord(s):
s = i
print(s)
\ No newline at end of file
arr = [input() for _ in range(int(input()))]
research = input()
for s in arr:
if research.lower() in s.lower():
print(s)
\ No newline at end of file
arr = ["Манная", "Гречневая", "Пшённая", "Овсяная", "Рисовая"]
n = int(input())
for i in range(n):
print(arr[i % 5])
\ No newline at end of file
arr = [int(input()) for _ in range(int(input()))]
p = int(input())
for i in arr:
print(i**p)
\ No newline at end of file
arr = [int(i) for i in input().split()]
p = int(input())
for i in arr:
print(i ** p, end=" ")
\ No newline at end of file
arr = [int(i) for i in input().split()]
nod = 0
for i in range(len(arr) - 1):
a, b = arr[i], arr[i + 1]
while a != b:
if a > b:
a -= b
else:
b -= a
arr[i + 1] = a
print(arr[-1])
\ No newline at end of file
length = int(input()) - 3
arr = [input() for _ in range(int(input()))]
for elem in arr:
if len(elem) < length:
print(elem)
length -= len(elem)
elif len(elem) == length:
print(f"{elem}...")
break
else:
print(f"{elem[:length]}...")
break
\ No newline at end of file
s = input().lower().replace(" ", "")
if s == s[::-1]:
print("YES")
else:
print("NO")
\ No newline at end of file
s = input()
sym = s[0]
c = 1
for i in s[1:]:
if sym == i:
c += 1
else:
print(sym, c)
sym = i
c = 1
print(sym, c)
\ No newline at end of file
arr = input().split()
stek = []
for elem in arr:
if elem in "*-+":
res = eval(f"{stek.pop(-2)} {elem} {stek.pop(-1)}")
stek.append(res)
else:
stek.append(int(elem))
print(stek[0])
\ No newline at end of file
s = input()
for i in s:
print(i)
\ No newline at end of file
arr = input().split()
stek = []
for elem in arr:
if elem in "*-+":
res = eval(f"{stek.pop(-2)} {elem} {stek.pop(-1)}")
stek.append(res)
elif elem == "/":
res = eval(f"{stek.pop(-2)} // {stek.pop(-1)}")
stek.append(res)
elif elem == "~":
res = stek.pop(-1) * (-1)
stek.append(res)
elif elem == "#":
stek.append(stek[-1])
elif elem == "!":
res = stek.pop(-1)
prod = 1
while res:
prod *= res
res -= 1
stek.append(prod)
elif elem == "@":
a, b, c = stek.pop(-3), stek.pop(-2), stek.pop(-1)
stek += [b, c, a]
else:
stek.append(int(elem))
print(stek[0])
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment