Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. static class FastReader {
  2. BufferedReader br;
  3. StringTokenizer st;
  4. public FastReader(){
  5. br = new BufferedReader(new
  6. InputStreamReader(System.in));
  7. }
  8. String next(){
  9. while (st == null || !st.hasMoreElements()){
  10. try {
  11. st = new StringTokenizer(br.readLine());
  12. }
  13. catch (IOException e) {
  14. e.printStackTrace();
  15. }
  16. }
  17. return st.nextToken();
  18. }
  19. int nextInt()
  20. {
  21. return Integer.parseInt(next());
  22. }
  23. long nextLong()
  24. {
  25. return Long.parseLong(next());
  26. }
  27. double nextDouble()
  28. {
  29. return Double.parseDouble(next());
  30. }
  31. String nextLine() {
  32. String str = "";
  33. try {
  34. str = br.readLine();
  35. }
  36. catch (IOException e) {
  37. e.printStackTrace();
  38. }
  39. return str;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement