From f534258a4428319e1033dbc4c0afaf29b8fd9b05 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 4 Apr 2021 21:45:11 +0400 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BE=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=D0=BB=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=20=5F=5Feq=5F=5F=20=D0=B2=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=81=D0=B5=20Point?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-func/task10.py | 3 +++ python-func/task11.py | 13 ++++++++----- python-func/task8.py | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/python-func/task10.py b/python-func/task10.py index 8c548e1..1484f2d 100644 --- a/python-func/task10.py +++ b/python-func/task10.py @@ -6,6 +6,9 @@ class Point: self.x = x self.y = y + def __eq__(self, other): + return self.x == other.x and self.y == other.y + def dist(p1: Point, p2: Point) -> float: return sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2) diff --git a/python-func/task11.py b/python-func/task11.py index cd759fd..a33ffee 100644 --- a/python-func/task11.py +++ b/python-func/task11.py @@ -6,6 +6,9 @@ class Point: self.x = x self.y = y + def __eq__(self, other): + return self.x == other.x and self.y == other.y + def dist(p1: Point, p2: Point) -> float: return sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2) @@ -32,11 +35,11 @@ def solve(a: Point, b: Point, c: Point, d: Point, e: Point) -> float: return a1 + a2 + a3 -ax, ay = map(int, input("Ax, Ay = ").split()) -bx, by = map(int, input("Bx, By = ").split()) -cx, cy = map(int, input("Cx, Cy = ").split()) -dx, dy = map(int, input("Dx, Dy = ").split()) -ex, ey = map(int, input("Ex, Ey = ").split()) +ax, ay = map(float, input("Ax, Ay = ").split()) +bx, by = map(float, input("Bx, By = ").split()) +cx, cy = map(float, input("Cx, Cy = ").split()) +dx, dy = map(float, input("Dx, Dy = ").split()) +ex, ey = map(float, input("Ex, Ey = ").split()) res = solve( Point(ax, ay) , Point(bx, by) diff --git a/python-func/task8.py b/python-func/task8.py index 923d598..345496f 100644 --- a/python-func/task8.py +++ b/python-func/task8.py @@ -1,6 +1,7 @@ def digit_sum(n: int) -> int: return sum(map(int, str(n))) + print("Счастливые билеты:") for i in range(100, 1000): for j in range(100, 1000): -- cgit v1.2.3