답변 2개
채택된 답변
+20 포인트
4년 전
먼저 https://sir.kr/qa/420040 답변채택부터 해 주세요.
정답에 근접한 답변을 받았음에도 불구하고 답변채택을 하지 않으시면 그 어떤 답변자라 하더라도 그 다음에는 답변을 해 드리지 않을 것입니다.
첫번째 답변
</p>
<p><script>
b = Math.floor((Math.random() * 6 + 1));
d = Math.floor((Math.random() * 6 + 1));
e = Math.floor((Math.random() * 6 + 1));
f = Math.floor((Math.random() * 6 + 1));
g = Math.floor((Math.random() * 6 + 1));
my = [b, d, e, f, g];
document.write(my + "
");
my = my.sort();
plusNum = 0;
for (i in my) plusNum = plusNum + my[i];
if (my[0] == my[1] && my[3] == my[4] && my[0] != my[4] && (my[2] == my[0] || my[2] == my[4])) document.write("조건만족 : 총합은 " + plusNum + " 입니다");
else document.write("조건에 맞지 않습니다");
</script></p>
<p>
두번째 답변
</p>
<p><script>
b = Math.floor((Math.random() * 6 + 1));
d = Math.floor((Math.random() * 6 + 1));
e = Math.floor((Math.random() * 6 + 1));
f = Math.floor((Math.random() * 6 + 1));
g = Math.floor((Math.random() * 6 + 1));
my = [b, d, e, f, g];
document.write(my + "
");
you = [1, 2, 3, 4, 5];
if (my.join() == you.join()) document.write("조건에 만족합니다");
else document.write("조건에 맞지 않습니다");
</script></p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인