본문 바로가기

코딩

[Python] 백준 #10101. 삼각형 외우기

https://www.acmicpc.net/problem/10101

 

10101번: 삼각형 외우기

문제의 설명에 따라 Equilateral, Isosceles, Scalene, Error 중 하나를 출력한다.

www.acmicpc.net

 

# 10101 - Python 3

import sys

input =sys.stdin.readline

arr = []

for i in range(3):
    arr.append(int(input()))

if len(set(arr)) == 1:                          # set 함수를 이용하여 중복되는 수의 개수를 찾음
    print("Equilateral")
elif sum(arr) == 180 and len(set(arr)) == 2:
    print("Isosceles")
elif sum(arr) == 180 and len(set(arr)) == 3:
    print("Scalene")
else:
    print("Error")