Q4 1-5
This commit is contained in:
@@ -17,6 +17,9 @@ public class PTra04_01 {
|
||||
// TODO while文の条件を修正して5が出力されたら繰り返しを止めるようにしてください。
|
||||
while(true) {
|
||||
// 0~9のランダムな値を生成
|
||||
if (randomNumber==5) {
|
||||
break;
|
||||
}
|
||||
randomNumber = random.nextInt(10);
|
||||
// 生成した値をコンソールに出力
|
||||
System.out.println(randomNumber);
|
||||
|
||||
Reference in New Issue
Block a user