JS) 삼각형 판별하기

Mongle·2022년 11월 28일
0
function solution(a, b, c){
                let answer;
                let max = a;

                for (let x of [b,c]){
                    if (max <= x){
                        max = x
                    }
                }

                let total = a+b+c;

                if(total - max > max){
                    answer = 'YES'
                }else{
                    answer = 'NO'
                }
                
                return answer;
            }
profile
https://github.com/Jeongseo21

0개의 댓글