SHARE
TWEET

Untitled

moisey312 Jan 22nd, 2020 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class FastScanner
  2. {
  3.    private BufferedReader br;
  4.    private StringTokenizer st;
  5.    public FastScanner(InputStreamReader reader)
  6.    {
  7.        br = new BufferedReader(reader);
  8.    }
  9.    public String next()
  10.    {
  11.        while (st == null || !st.hasMoreTokens())
  12.        {   try
  13.            {
  14.                st = new StringTokenizer(br.readLine());
  15.            } catch (Exception e)
  16.            {
  17.                e.printStackTrace();
  18.            }
  19.        }
  20.        return st.nextToken();
  21.    }
  22.    public int nextInt()
  23.    {
  24.        return Integer.parseInt(next());
  25.    }
  26.    public double nextDouble()
  27.    {
  28.        return Double.parseDouble(next());
  29.    }
  30.    public void close() throws Exception
  31.    {
  32.        br.close();
  33.    }}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top