This commit is contained in:
2026-09-17 15:13:03 +09:00
parent 2aa81223c4
commit b3a4136c02
5 changed files with 79 additions and 3 deletions

View File

@@ -17,11 +17,16 @@ public class PTra04_03 {
// TODO 5が出力されたら繰り返しを止めるようにしてください。
// ※ while文の条件は変更せずにbreak文を使ってください。
while(true) {
// 0~9のランダムな値を生成
randomNumber = random.nextInt(10);
// 生成した値をコンソールに出力
System.out.println(randomNumber);
if(randomNumber==5) {
break;
}
}
}
}
}