如何使用排列三的组合图来找出所有可能的号码组合?

智多星 943 0
问题描述
如何使用排列三的组合图来找出所有可能的号码组合?
精选答案
<% for (let i = 0; i < 1000; i++) { %> <% let num1 = Math.floor(Math.random() * 10); %> <% let num2 = Math.floor(Math.random() * 10); %> <% let num3 = Math.floor(Math.random() * 10); %> <% if (num1 !== num2 && num1 !== num3 && num2 !== num3) { %> <% } %> <% } %>
组合编号 号码组合
<%= i + 1 %> <%= num1 + num2 * 10 + num3 %>