Question04 01
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* PTra04_01.java
|
* PTra04_01.java
|
||||||
* 作成 Rhizome
|
* 作成 Rhizome
|
||||||
@@ -18,6 +19,11 @@ public class PTra04_01 {
|
|||||||
while (true) {
|
while (true) {
|
||||||
// 0~9のランダムな値を生成
|
// 0~9のランダムな値を生成
|
||||||
randomNumber = random.nextInt(10);
|
randomNumber = random.nextInt(10);
|
||||||
|
|
||||||
|
if (randomNumber == 5) {
|
||||||
|
System.out.println("5が出力されたため処理を終了します");
|
||||||
|
break;
|
||||||
|
}
|
||||||
// 生成した値をコンソールに出力
|
// 生成した値をコンソールに出力
|
||||||
System.out.println(randomNumber);
|
System.out.println(randomNumber);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user