Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

java runtime error的话,语言的要注入输入的问题,提供一个网友写的输入类

Posted by frady at 2020-06-29 09:18:57 on Problem 1696
一直runtime,StringTokenizer和Scanner都试过了,还是不行
用这个替换之后,AC了
static class sc{
        static BufferedReader reader;
        static StringTokenizer tokenizer;
        static void init(InputStream input){
            reader=new BufferedReader(new InputStreamReader(input));
            tokenizer=new StringTokenizer("");
        }
        static String next() throws IOException{
            while(!tokenizer.hasMoreTokens()){
                tokenizer=new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }
        static int nextInt() throws IOException{
            return Integer.parseInt(next());
        }

    }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator