coderrohan14

FastIO.java

Apr 30th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4. class Main {
  5.  
  6. static FastReader sc;
  7. static PrintWriter out;
  8.  
  9. public static void main(String[] args) {
  10. sc = new FastReader(new InputStreamReader(System.in));
  11. out = new PrintWriter(System.out);
  12. solve();
  13. out.flush();
  14. out.close();
  15. }
  16.  
  17. static void solve() {
  18. // Write your code here...
  19.  
  20. }
  21.  
  22. static class FastReader { // Fast Input Class
  23. BufferedReader br;
  24. StringTokenizer st;
  25.  
  26. public FastReader(Reader r) {
  27. br = new BufferedReader(r);
  28. }
  29.  
  30. String next() {
  31. while (st == null || !st.hasMoreElements()) {
  32. try {
  33. st = new StringTokenizer(br.readLine());
  34. } catch (IOException e) {
  35. e.printStackTrace();
  36. }
  37. }
  38. return st.nextToken();
  39. }
  40.  
  41. int nextInt() {
  42. return Integer.parseInt(next());
  43. }
  44.  
  45. long nextLong() {
  46. return Long.parseLong(next());
  47. }
  48.  
  49. double nextDouble() {
  50. return Double.parseDouble(next());
  51. }
  52.  
  53. String nextLine() {
  54. String str = "";
  55. try {
  56. str = br.readLine();
  57. } catch (IOException e) {
  58. e.printStackTrace();
  59. }
  60. return str;
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment