Combothermal

Codeforces Template

Jun 19th, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.StringTokenizer;
  3.  
  4. public class CodeforcesTemplate {
  5. public static void main(String[] args) throws IOException {
  6. FastScanner in = new FastScanner();
  7. }
  8.  
  9. public static class FastScanner {
  10. BufferedReader br;
  11. StringTokenizer st;
  12.  
  13. public FastScanner(String s) {
  14. try {
  15. br = new BufferedReader(new FileReader(s));
  16. } catch (FileNotFoundException e) {
  17. // TODO Auto-generated catch block
  18. e.printStackTrace();
  19. }
  20. }
  21.  
  22. public FastScanner() {
  23. br = new BufferedReader(new InputStreamReader(System.in));
  24. }
  25.  
  26. String nextToken() {
  27. while (st == null || !st.hasMoreElements()) {
  28. try {
  29. st = new StringTokenizer(br.readLine());
  30. } catch (IOException e) {
  31. // TODO Auto-generated catch block
  32. e.printStackTrace();
  33. }
  34. }
  35. return st.nextToken();
  36. }
  37.  
  38. String nextLine() {
  39. st = null;
  40. try {
  41. return br.readLine();
  42. } catch (IOException e) {
  43. // TODO Auto-generated catch block
  44. e.printStackTrace();
  45. }
  46. return null;
  47. }
  48.  
  49. int nextInt() {
  50. return Integer.parseInt(nextToken());
  51. }
  52.  
  53. long nextLong() {
  54. return Long.parseLong(nextToken());
  55. }
  56.  
  57. double nextDouble() {
  58. return Double.parseDouble(nextToken());
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment