init
This commit is contained in:
32
Question22-FunctionAndLambda/src/PTra22_05.java
Normal file
32
Question22-FunctionAndLambda/src/PTra22_05.java
Normal file
@@ -0,0 +1,32 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/*
|
||||
* PTra22_05.java
|
||||
* 作成 Rhizome
|
||||
*------------------------------------------------------------
|
||||
* Copyright(c) Rhizome Inc. All Rights Reserved.
|
||||
*/
|
||||
public class PTra22_05 {
|
||||
public static void main(String[] args) {
|
||||
List<Integer> array = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
Random rnd = new Random();
|
||||
|
||||
System.out.println("計算元の値です");
|
||||
for (Integer number : array) {
|
||||
System.out.print(number + "\t");
|
||||
}
|
||||
int rndNumber1 = rnd.nextInt(9);
|
||||
int rndNumber2 = rnd.nextInt(9);
|
||||
int rndNumber3 = rnd.nextInt(9);
|
||||
System.out.println("\n" + "ランダムに数値を3つ選び足し算します(選ばれた順に足し算します)");
|
||||
/*
|
||||
* TODO 以下処理を作成してください。
|
||||
* x,y,zを足して返却する処理
|
||||
* ラムダ式の省略形を使用して作成してください
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user