• java 输入挂


    替换Scanner

        static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        static StringTokenizer tokenizer = new StringTokenizer("");
        static String nextLine() throws IOException {// 读取下一行字符串
            return reader.readLine();
        }
        static String next() throws IOException {// 读取下一个字符串
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }
    
        static int nextInt() throws IOException {// 读取下一个int型数值
            return Integer.parseInt(next());
        }
    
        static long nextLong() throws IOException {// 读取下一个long型数值
            return Long.parseLong(next());
        }
    
        static double nextDouble() throws IOException {// 读取下一个double型数值
            return Double.parseDouble(next());
        }
  • 相关阅读:
    线程
    自定义异常
    throw 子句
    throw 语句
    异常处理
    异常处理
    匿名类
    接口的使用,内部类
    接口,接口的定义
    如何理解无偏估计?无偏估计有什么用?什么是无偏估计?
  • 原文地址:https://www.cnblogs.com/zuferj115/p/11562850.html
Copyright © 2020-2023  润新知