我的问题是我不知道如何在循环中获取char。它必须是随机的,每个char必须循环10次。谢谢public class Main {
public static void main(String[] args) {
field();
}
public static void field() {
final int WIDTH = 11;
final int HEIGHT = 18;
Random random = new Random();
char l = 'L';
char o = 'O';
char u = 'U';
for (int i = 0; i <= WIDTH * HEIGHT; i++) {
if (i % 12 == 0) {
System.out.println();
}
else {
System.out.print(".");
}
}
}}
添加回答
举报
0/150
提交
取消