It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                7年前关闭。
            
        

我想用Java编写一个生成1到1百万之间数字的程序,任何数字都不应重复,也不应该错过任何人。我不知道从哪里开始。我无法记录我使用过的所有数字,这是不切实际的。我该怎么做呢?

最佳答案

将1到1,000,000之间的整数存储在数组列表中。 Randomly shuffle列表并打印出其内容。

关于java - 我想创建一个程序,以随机顺序打印1到1,000,000之间的数字。不得重复或遗漏任何号码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13603679/

10-11 22:29
查看更多