코드 :
function check8(x, y) {
if (x == 8 || y == 8) {
return true;
}
if (x + y == 8 || Math.abs(x - y) == 8)
{
return true;
}
return false;
}
console.log(check8(7, 8));
console.log(check8(16, 8));
console.log(check8(24, 32));
console.log(check8(17, 18));
합계 :
true
true
true
false
등록된 댓글이 없습니다.