public class ExControl7 {
public static void main(String[] args) {
int[][] slot = {{ 4, 35, 63, 16, 50 },
{ 59, 89, 12, 32, 9 }}; //(1)
int award = 50;
boolean judgment = false;
bingo: //(2)
for (int i = 0; i < slot.length; i++) { //(3)
for (int j = 0; j < slot[i].length; j++) { //(4)
if (slot[i][j] == award ) { //(5)
judgment = true; //(6)
break bingo; //(7)
}
}
}
if (judgment) { //(8)
System.out.println("当選です。");
} else {
System.out.println("落選です。");
}
}
}
|