diff --git a/1.py b/1.py new file mode 100644 index 0000000..d85a1aa --- /dev/null +++ b/1.py @@ -0,0 +1,2 @@ +n = int(input()) +print((n // 60) % 24, n % 60) diff --git a/2.py b/2.py new file mode 100644 index 0000000..8007a6b --- /dev/null +++ b/2.py @@ -0,0 +1,3 @@ +n = int(input()) +text = str(input()) +print('Hello', (text + ', ')*(n - 1), text) diff --git a/3.py b/3.py new file mode 100644 index 0000000..5e49135 --- /dev/null +++ b/3.py @@ -0,0 +1,4 @@ +a = [] +for i in range(3): + a.append(int(input())) +print(min(a)) \ No newline at end of file diff --git a/4.py b/4.py new file mode 100644 index 0000000..73948f7 --- /dev/null +++ b/4.py @@ -0,0 +1,7 @@ +distance = 109 +speed = int(input()) +time = int(input()) +if speed > 0: + print((speed * time) % distance) +else: + print(distance - (abs(speed * time) % distance)) diff --git a/5.py b/5.py new file mode 100644 index 0000000..e0569ac --- /dev/null +++ b/5.py @@ -0,0 +1,7 @@ +import math +n = int(input()) +k = 0 +while n != 0: + k += math.factorial(n) + n -= 1 +print(k) \ No newline at end of file diff --git a/6.py b/6.py new file mode 100644 index 0000000..e2aa304 --- /dev/null +++ b/6.py @@ -0,0 +1,8 @@ +a = [] +x = int(input()) +while x != 0: + a.append(x) + x = int(input()) +mx = max(a) +a.remove(mx) +print(max(a)) \ No newline at end of file diff --git a/7.py b/7.py new file mode 100644 index 0000000..38ff68e --- /dev/null +++ b/7.py @@ -0,0 +1,7 @@ +a = [] +n = int(input()) +for i in range(n): + a.append(int(input())) +for i in range(n): + if i % 2 == 0: + print(a[i]) diff --git a/8.py b/8.py new file mode 100644 index 0000000..d7f7ecf --- /dev/null +++ b/8.py @@ -0,0 +1,7 @@ +a = [] +n = int(input()) +for i in range(n): + a.append(int(input())) +for i in range(n): + if a[i] % 2 == 0: + print(a[i]) diff --git a/9.py b/9.py new file mode 100644 index 0000000..36ef66a --- /dev/null +++ b/9.py @@ -0,0 +1,10 @@ +def distance(a, b, c, d): + dist = ((a - b)**2 + (c - d)**2)**0.5 + print(dist) + + +x1 = float(input()) +x2 = float(input()) +y1 = float(input()) +y2 = float(input()) +distance(x1, x2, y1, y2) \ No newline at end of file diff --git a/S.py b/S.py new file mode 100644 index 0000000..a814054 --- /dev/null +++ b/S.py @@ -0,0 +1,12 @@ +import turtle + +turtle.shape('turtle') +turtle.forward(50) +turtle.left(90) +turtle.forward(50) +turtle.left(90) +turtle.forward(50) +turtle.right(90) +turtle.forward(50) +turtle.right(90) +turtle.forward(50) \ No newline at end of file diff --git a/babachka.py b/babachka.py new file mode 100644 index 0000000..e96caba --- /dev/null +++ b/babachka.py @@ -0,0 +1,21 @@ +import turtle as t + + +def krug(n, k): + t.right(n) + for i in range(360): + t.forward(k) + t.right(1) + + +t.speed(0) +t.right(90) +p = 10 +r = 1 +gradus = 0 +while p != 0: + gradus %= 360 + krug(gradus, r) + krug(180 - gradus, r) + r += 0.1 + p -= 1 \ No newline at end of file diff --git a/dugi.py b/dugi.py new file mode 100644 index 0000000..e1c8567 --- /dev/null +++ b/dugi.py @@ -0,0 +1,15 @@ +import turtle as t + + +def duga(n): + for i in range(180): + t.forward(n) + t.right(1) + + +t.left(90) +k = 10 +while k != 0: + duga(1) + duga(0.1) + k -= 1 \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..f7753be --- /dev/null +++ b/hello.py @@ -0,0 +1,3 @@ +print("hello world") +print(2*3) +#jdsflkdfhkfddlgkl \ No newline at end of file diff --git a/hypot.py b/hypot.py new file mode 100644 index 0000000..038f75f --- /dev/null +++ b/hypot.py @@ -0,0 +1,4 @@ +a = 179 +b = 197 +c = (a ** 2 + b ** 2) ** 0.5 +print (c) \ No newline at end of file diff --git a/krugi.py b/krugi.py new file mode 100644 index 0000000..a96f6b4 --- /dev/null +++ b/krugi.py @@ -0,0 +1,14 @@ +import turtle as t + + +def krug(n): + t.right(n) + for i in range(360): + t.forward(1) + t.right(1) + + +k = 0 +while k != 360: + krug(k) + k += 30 \ No newline at end of file diff --git a/kvadratnayaspiral.py b/kvadratnayaspiral.py new file mode 100644 index 0000000..31d23b8 --- /dev/null +++ b/kvadratnayaspiral.py @@ -0,0 +1,15 @@ +import turtle as t + + +def polukvadrat(nach, kon): + while nach != kon: + t.forward(nach) + t.left(90) + t.forward(nach) + t.left(90) + nach += 4 + + +x = 5 +y = 150 +polukvadrat(x, y) \ No newline at end of file diff --git a/smile.py b/smile.py new file mode 100644 index 0000000..6a50cf8 --- /dev/null +++ b/smile.py @@ -0,0 +1,50 @@ +import turtle as t + + +def duga(n): + for i in range(180): + t.forward(n) + t.right(1) + + +def krug(n): + for i in range(360): + t.forward(n) + t.left(1) + + +t.speed(0) +t.color('yellow') +t.begin_fill() +krug(3) +t.end_fill() +t.penup() +t.left(90) +t.forward(250) +t.left(90) +t.forward(70) +t.pendown() +t.color('blue') +t.begin_fill() +krug(0.3) +t.end_fill() +t.penup() +t.right(180) +t.forward(140) +t.pendown() +t.right(180) +t.begin_fill() +krug(0.3) +t.end_fill() +t.penup() +t.forward(70) +t.left(90) +t.forward(70) +t.pendown() +t.forward(70) +t.penup() +t.left(90) +t.forward(60) +t.pendown() +t.right(90) +duga(1) \ No newline at end of file diff --git a/spiral.py b/spiral.py new file mode 100644 index 0000000..8a94dc7 --- /dev/null +++ b/spiral.py @@ -0,0 +1,19 @@ +import turtle as t + + +def krug(n): + for i in range(180): + t.forward(n) + t.right(1) + + +def duga(x, y): + while x != y: + krug(x) + x += 0.1 + + +t.speed(0) +x = 1 +y = 10 +duga(x, y) \ No newline at end of file diff --git a/turtle1.py b/turtle1.py new file mode 100644 index 0000000..8d7abf7 --- /dev/null +++ b/turtle1.py @@ -0,0 +1,7 @@ +import turtle as t +n = 4 +while n > 0: + t.forward(200) + t.left(90) + n -= 1 + diff --git a/turtle2.py b/turtle2.py new file mode 100644 index 0000000..ae2bcad --- /dev/null +++ b/turtle2.py @@ -0,0 +1,6 @@ +import turtle as t +n = 720 +while n != 0: + t.forward(0.5) + t.right(0.5) + n -= 1 diff --git a/turtle3.py b/turtle3.py new file mode 100644 index 0000000..32dfed3 --- /dev/null +++ b/turtle3.py @@ -0,0 +1,22 @@ +import turtle as t +n = 10 +k = 4 +side = 10 +while n > 0: + while k > 0: + t.forward(side) + t.left(90) + k -= 1 + k = 4 + t.penup() + t.right(90) + t.forward(4) + t.right(90) + t.forward(4) + t.right(180) + t.pendown() + side += 8 + n -= 1 + + + diff --git a/turtle4.py b/turtle4.py new file mode 100644 index 0000000..42806b5 --- /dev/null +++ b/turtle4.py @@ -0,0 +1,10 @@ +import turtle as t +n = int(input()) +k = n +t.left(90) +while n > 0: + t.forward(100) + t.stamp() + t.goto(0.00, 0.00) + t.right(360/k) + n -= 1 \ No newline at end of file diff --git a/week4-1.py b/week4-1.py new file mode 100644 index 0000000..223985a --- /dev/null +++ b/week4-1.py @@ -0,0 +1,9 @@ +a = [] +count = 0 +n = int(input()) +for i in range(n): + a.append(int(input())) +for i in range(2, n): + if a[i-1] > a[i - 2] and a[i - 1] > a[i]: + count += 1 +print(count) diff --git a/week4-2.py b/week4-2.py new file mode 100644 index 0000000..5b450ea --- /dev/null +++ b/week4-2.py @@ -0,0 +1,15 @@ +a = [] +a1 = 0 +a2 = 0 +n = int(input()) +for i in range(n): + a.append(int(input())) +b = max(a) +c = min(a) +for i in range(n): + if a[i] == b: + a1 = i + if a[i] == c: + a2 = i +a[a1], a[a2] = a[a2], a[a1] +print(a) \ No newline at end of file diff --git a/week4-3.py b/week4-3.py new file mode 100644 index 0000000..b544bd9 --- /dev/null +++ b/week4-3.py @@ -0,0 +1,10 @@ +a = [] +count = 0 +n = int(input()) +for i in range(n): + a.append(int(input())) +for i in range(n - 1): + for j in range(i + 1, n): + if a[i] == a[j]: + count += 1 +print(count) \ No newline at end of file diff --git a/week4-4.py b/week4-4.py new file mode 100644 index 0000000..1cd3be2 --- /dev/null +++ b/week4-4.py @@ -0,0 +1,14 @@ +a = [] +b = [] +n = int(input()) +for i in range(n): + a.append(int(input())) +for i in range(n): + b.append(a.count(a[i])) +for i in range(n): + if b[i] > 1: + c = a[i] + while b[i] > 0: + a.remove(c) + b[i] -= 1 +print(a) \ No newline at end of file diff --git a/week4-5.py b/week4-5.py new file mode 100644 index 0000000..ad4a831 --- /dev/null +++ b/week4-5.py @@ -0,0 +1,12 @@ +a = [] +b = [] +n = int(input()) +for i in range(n): + a.append(int(input())) + b.append(int(input())) +a = set(a) +b = set(b) +print(a, b) +c = set.intersection(a, b) +с = list(c) +print(c) \ No newline at end of file diff --git a/week4-6.py b/week4-6.py new file mode 100644 index 0000000..4f6fd90 --- /dev/null +++ b/week4-6.py @@ -0,0 +1,14 @@ +string = str(input()) +spisok = list(string) +c = set() +print(spisok) +while spisok.count(' ') != 0: + spisok.remove(' ') +for i in range(len(spisok)): + if spisok[i] in c: + print('yes') + else: + c.add(spisok[i]) + print('no') +print(c) +print(spisok) diff --git a/week4-7.py b/week4-7.py new file mode 100644 index 0000000..c37be4b --- /dev/null +++ b/week4-7.py @@ -0,0 +1,11 @@ +a = [] +counts = int(input()) +for i in range(counts): + string_with_words = input() + b = string_with_words.split() + a = a + b +a = list(set(a)) +t = len(a) +print(t) + + diff --git "a/\321\204\320\260\320\274\320\270\320\273\320\270\321\217 \320\270\320\274\321\217" "b/\321\204\320\260\320\274\320\270\320\273\320\270\321\217 \320\270\320\274\321\217" new file mode 100644 index 0000000..0a2a446 --- /dev/null +++ "b/\321\204\320\260\320\274\320\270\320\273\320\270\321\217 \320\270\320\274\321\217" @@ -0,0 +1 @@ +Самохвалов Егор