
방법1
while True:
lst = map(int,input().split())
x,y,z = sorted(lst)
if x+y+z == 0:
break
elif z >= x+y:
print("Invalid")
elif x==y==z :
print("Equilateral")
elif x==y or x==z or y==z:
print("Isosceles")
else:
print("Scalene")
방법2
while True:
tri = list(map(int,input().split()))
tri.sort()
if sum(tri) == 0:
break
elif tri[2] >=sum(tri[0:2]):
print("Invalid")
elif tri.count(tri[0]) == 3:
print("Equilateral")
elif tri.count(tri[0]) == 2 or tri.count(tri[1]) == 2:
print("Isosceles")
else:
print("Scalene")
| [파이썬/python] 백준 시간복잡도 문제(24262/24263/24264/24265/24266/24267) (0) | 2023.03.25 |
|---|---|
| [파이썬/python] 백준 14215번 : 세 막대(🥉3) (0) | 2023.03.25 |
| [파이썬/python] 백준 2563번 : 색종이(🥈5) (0) | 2023.03.25 |
| [파이썬/python] 백준 9063번 : 대지(🥉3) (0) | 2023.03.24 |
| [파이썬/python] 백준 10798번 : 세로읽기 (🥉1) (0) | 2023.03.24 |