Q4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user