작성자 없음
작성자 정보가 삭제된 글입니다.
작성
·
333
0
function isItTriangle(A, B, C) {
// Step 1: Construct a function that takes three arguments
// Step 2: Compare the sum of two values to one arg
// Step 3: If the sum is greater than the one arg, return true otherwise false
if (A + B > C && A + C > B && B + C > A) {
return 'YES';
} else {
return 'NO';
}
}
console.log('Case 1: ' + isItTriangle(6, 7, 11));
console.log('Case 2: ' + isItTriangle(13, 33, 17));
const answer2 = document.querySelector('#q3');
answer2.append(isItTriangle);