728x90
728x90

문제

https://www.hackerrank.com/challenges/what-type-of-triangle/problem?isFullScreen=true

 

Type of Triangle | HackerRank

Query a triangle's type based on its side lengths.

www.hackerrank.com

Equilateral: It's a triangle with sides of equal length.

정삼각형 : 변의 길이가 같은 삼각형입니다. 

Isosceles: It's a triangle with sides of equal length.

이등변삼각형: 변의 길이가 같은 삼각형입니다. 

 

Scalene: It's a triangle with sides of differing lengths.

Scalene: 변의 길이가 다른 삼각형입니다. 

 

Not A Triangle: The given values of A, B, and C don't form a triangle.

삼각형이 아님: 주어진 A, B, C 값은 삼각형을 형성하지 않습니다.

 
 

 

 

 

 

 

풀이(MSSQL)

SELECT CASE WHEN A = B AND B = C THEN 'Equilateral'
	WHEN A+B <= C OR A+C <= B OR B+C <= A THEN 'Not A Triangle'
	WHEN A = B OR B = C OR A = C THEN 'Isosceles'
	ELSE 'Scalene' END
  FROM TRIANGLES
728x90
300x250