黑马程序员技术交流社区

标题: 求解 [打印本页]

作者: longqian    时间: 2016-4-15 00:36
标题: 求解
                public static void main(String[] args) {
                                int[] arr = new int[5];

                                Scanner sc = new Scanner(System.in);
                                System.out.println("12345");

                                for (int i = 0; i < 5; i++) {
                                        arr[i] = sc.nextInt();
                                        //System.out.println(arr[i]);

                                }
                                get(arr);
                        }

                        public static void get(int[] arr) {
                                Arrays.sort(arr);
                                System.out.println(arr[0]);
                                System.out.println(arr[arr.length - 1]);
                        }
               

        }






欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2