From a4366d0b359cd19cec7697efb419d109869a98aa Mon Sep 17 00:00:00 2001 From: yenru0 Date: Wed, 29 Apr 2020 20:23:12 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=ED=95=98=EC=A7=84=EC=9D=B4=20?= =?UTF-8?q?=EB=A7=A4=EC=9A=B0=20=EA=B4=9C=EC=B0=AE=EC=9D=80=20=EA=B9=A8?= =?UTF-8?q?=EB=8B=AC=EC=9D=8C=EC=9D=84=20=EC=96=BB=EB=8A=94=20=EA=B3=BC?= =?UTF-8?q?=EC=A0=95=20Vol.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zeta_python/completed/1002.py | 17 +++++++++++++++++ zeta_python/completed/10870.py | 9 +++++++++ zeta_python/completed/2231.py | 11 +++++++++++ zeta_python/completed/3009.py | 15 +++++++++++++++ zeta_python/completed/4153.py | 10 ++++++++++ 5 files changed, 62 insertions(+) create mode 100644 zeta_python/completed/1002.py create mode 100644 zeta_python/completed/10870.py create mode 100644 zeta_python/completed/2231.py create mode 100644 zeta_python/completed/3009.py create mode 100644 zeta_python/completed/4153.py diff --git a/zeta_python/completed/1002.py b/zeta_python/completed/1002.py new file mode 100644 index 0000000..1d1a8bc --- /dev/null +++ b/zeta_python/completed/1002.py @@ -0,0 +1,17 @@ +T = int(input()) +for i in range(T): + x1, y1, r1, x2, y2, r2 = map(int, input().split()) + dist:int = (x1-x2)**2 + (y1- y2)**2 + distR:int = (r1+r2)**2 + if dist == 0 and r1 == r2: + print(-1) + elif dist < (r1-r2)**2: + print(0) + elif dist == (r1-r2)**2: + print(1) + elif dist > distR: + print(0) + elif dist < distR: + print(2) + elif dist == distR: + print(1) diff --git a/zeta_python/completed/10870.py b/zeta_python/completed/10870.py new file mode 100644 index 0000000..1fe5aa3 --- /dev/null +++ b/zeta_python/completed/10870.py @@ -0,0 +1,9 @@ +def fib(n): + if not n: + return 0 + elif n == 1: + return 1 + else: + return fib(n-1) + fib(n-2) + +print(fib(int(input()))) diff --git a/zeta_python/completed/2231.py b/zeta_python/completed/2231.py new file mode 100644 index 0000000..7d7ff2b --- /dev/null +++ b/zeta_python/completed/2231.py @@ -0,0 +1,11 @@ +N = int(input()) + +def seps(n): + return n + sum(map(int, str(n))) + +for i in range(1 if N < 101 else N-100, N): + if seps(i) == N: + print(i) + break +else: + print(0) \ No newline at end of file diff --git a/zeta_python/completed/3009.py b/zeta_python/completed/3009.py new file mode 100644 index 0000000..0f3da0e --- /dev/null +++ b/zeta_python/completed/3009.py @@ -0,0 +1,15 @@ +A =[list(map(int, input().split())) for i in range(3)] + +if A[0][0] == A[1][0]: + print(A[2][0], end=" ") +elif A[1][0] == A[2][0]: + print(A[0][0], end=" ") +else: + print(A[1][0], end=" ") + +if A[0][1] == A[1][1]: + print(A[2][1], end="") +elif A[1][1] == A[2][1]: + print(A[0][1], end="") +else: + print(A[1][1], end="") \ No newline at end of file diff --git a/zeta_python/completed/4153.py b/zeta_python/completed/4153.py new file mode 100644 index 0000000..45f70e6 --- /dev/null +++ b/zeta_python/completed/4153.py @@ -0,0 +1,10 @@ +I = list(map(int, input().split())) +while I[0] != 0: + I.sort() + if I[0] ** 2 + I[1] ** 2 == I[2] ** 2: + print("right") + else: + print("wrong") + + + I = list(map(int, input().split())) \ No newline at end of file