大家好,欢迎来到IT知识分享网。
String[] names = new String[18];
names[0] = “James Raider”;
names[1] = “Calm Hain”;
names[2] = “Ewds Ashby”;
names[3] = “Gedge Taylor”;
names[4] = “Hay Fin”;
names[5] = “Ian Hilton”;
names[6] = “John Coke”;
names[7] = “Nathan Dryer”;
names[8] = “Jess Maguire”;
names[9] = “Jamie Loyal”;
names[10] = “Luke Shwinger”;
names[11] = “Parrot Tom”;
names[12] = “John Clarke”;
names[13] = “Steven Mason”;
names[14] = “Shing Lao”;
names[15] = “Tom Brook”;
names[16] = “Arthitus Pint”;
names[17] = “Yifan Yao”;
StringBuilder sb = new StringBuilder();
ArrayList list = new ArrayList();
for (int i = 0; i < names.length; i++) {
list.add(i);
}
Collections.shuffle(list);
for (int i = 0; i < names.length; i++) {
field.append(names[list.get(i)] + “\n”);
for (int u = 0; u < (Integer) number.getValue(); u++) {
field.append(“\n”);
}
}
我试图每次都在输出中添加新行number.getValue()。我正在做的是在每行之后添加它,但是我只希望它在设置一定次数后创建它。
例子:3次
Harry
John
Jake
Amanda
Holly
Sam
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/11851.html