import java.util.*; public class Main { public static void main(String[] args) throws Exception { Random rng = new Random(); //1 = 32 ~~ 65 //2 = 27 ~~ 68 //1*4 == 2: 2*4 == 3: 3*3 == 5 int deta1; int [][] c1 = { {0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0}, {1,1,1,1,0,0,0,0,0,0,0}, {1,1,1,1,1,1,1,1,0,0,0}, {1,1,1,1,1,1,1,1,0,0,0} }; System.out.println("二組の配置ランダム(不完全・テスト)"); System.out.println(""); //2の処理 for (int d2 = 0; d2 <= 4; d2 ++){ for (int d1 = 0; d1 <= 10; d1 ++){ if (c1[d2][d1] == 0) { deta1 = rng.nextInt(32,65); c1[0][d1] = deta1; System.out.print((d1 + 1) + "本目の棒" + c1[0][d1] + " "); } else { System.out.print("0おけない00 "); } } System.out.println(""); } } }