본문 바로가기
CS (컴퓨터 사이언스)/Algorithm (알고리즘)

[알고리즘] 2.삼각형 판별하기

by dreamer10457 2023. 11. 25.
반응형
<html>
  <head>
    <meta charset="UTF-8" />
    <title>출력결과</title>
  </head>
  <body>
    <script>
      function solution(a, b, c) {
        const max = Math.max(a, b, c);
        const total = a + b + c;

        if (total - max > max) {
          return "YES";
        } else {
          return "NO";
        }
      }

      console.log(solution(6, 7, 11));
    </script>
  </body>
</html>
반응형