Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FastScanner
- {
- private BufferedReader br;
- private StringTokenizer st;
- public FastScanner(InputStreamReader reader)
- {
- br = new BufferedReader(reader);
- }
- public String next()
- {
- while (st == null || !st.hasMoreTokens())
- { try
- {
- st = new StringTokenizer(br.readLine());
- } catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- return st.nextToken();
- }
- public int nextInt()
- {
- return Integer.parseInt(next());
- }
- public double nextDouble()
- {
- return Double.parseDouble(next());
- }
- public void close() throws Exception
- {
- br.close();
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement