package jp.co.jid.exec.collection;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class InputNumberUtil {

    public static int[] input(int num) {
         System.out.println("数字を入力して下さい。");
         BufferedReader br = null;
         int values[] = new int[num];
         try {
             br = new BufferedReader(new InputStreamReader(System.in));
             for (int i = 0; i < num;i++) {
            	 values[i] = Integer.parseInt(br.readLine());
             }
         } catch (IOException e) {
             return null;
         } finally {
             if (null != br) {
                 try {
                    br.close();
                } catch (IOException e) {
                    // 未処理
                }
             }
         }
         return values;
    }
}

