昆仑山:眼中无形心中有穴之穴人合一

夫君子之行,静以修身,俭以养德;非澹泊无以明志,非宁静无以致远。夫学须静也,才须学也;非学无以广才,非志无以成学。怠慢则不能励精,险躁则不能冶性。年与时驰,意与岁去,遂成枯落,多不接世。悲守穷庐,将复何及!

 

java多个输入数据的处理方法

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
//        去掉字符串首尾空格
        input = input.trim();
//        按照指定字符串分割某个字符串并以字符串数组形式返回
        String[] temp = input.split(" ");
        int m = Integer.parseInt(temp[0]);
        int n = Integer.parseInt(temp[1]);
        int o = Integer.parseInt(temp[2]);
        int p = Integer.parseInt(temp[3]);

        System.out.println(m);
        System.out.println(n);
        System.out.println(o);
        System.out.println(p);
    }

posted on 2021-05-25 09:51  Indian_Mysore  阅读(468)  评论(0)    收藏  举报

导航