import sys
while True:
arr = list(map(int, map(int, sys.stdin.readline().split())))
arr.sort()
if arr[0]==0 and arr[1]==0 and arr[2]==0:
break
if arr[0]**2 + arr[1]**2 == arr[2]**2:
print("right")
else:
print("wrong")
arr에 숫자를 받아놓고
정렬 한다
이후에 피타고라스 정리가 True or False 인지 확인하면 된다
'알고리즘' 카테고리의 다른 글
<백준> 7568번 파이썬 알고리즘 (0) | 2021.07.10 |
---|---|
<백준> 4949번 파이썬 알고리즘 (0) | 2021.07.10 |
<백준> 2805번 파이썬 알고리즘 (0) | 2021.07.09 |
<백준> 2805번 파이썬 알고리즘 (0) | 2021.07.09 |
<백준> 2292번 파이썬 알고리즘 (0) | 2021.07.08 |