Guest User

Untitled

a guest
Oct 17th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. import java.io.*;
  2. import java.math.*;
  3. import java.util.*;
  4.  
  5. public class Solution {
  6.  
  7. public void solve() throws IOException {
  8. }
  9.  
  10. public static void main(String[] args) throws IOException {
  11. Solution solution = new Solution();
  12. solution.run(new InputStreamReader(System.in),
  13. new OutputStreamWriter(System.out));
  14. System.exit(0);
  15. }
  16.  
  17. private BufferedReader reader;
  18. private StringTokenizer tokenizer;
  19. private String separator;
  20. public PrintWriter out;
  21.  
  22. public final byte getByte() throws IOException {
  23. return Byte.parseByte(getToken());
  24. }
  25.  
  26. public final double getDouble() throws IOException {
  27. return Double.parseDouble(getToken());
  28. }
  29.  
  30. public final int getInt() throws IOException {
  31. return Integer.parseInt(getToken());
  32. }
  33.  
  34. public final String getLine() throws IOException {
  35. if (tokenizer.hasMoreTokens()) {
  36. return tokenizer.nextToken(separator);
  37. }
  38. return reader.readLine();
  39. }
  40.  
  41. public final long getLong() throws IOException {
  42. return Long.parseLong(getToken());
  43. }
  44.  
  45. public final short getShort() throws IOException {
  46. return Short.parseShort(getToken());
  47. }
  48.  
  49. public final String getToken() throws IOException {
  50. while (!tokenizer.hasMoreTokens()) {
  51. tokenizer = new StringTokenizer(reader.readLine());
  52. }
  53. return tokenizer.nextToken();
  54. }
  55.  
  56. public final boolean isEndOfLine() {
  57. return tokenizer.hasMoreTokens();
  58. }
  59.  
  60. public final void putBlank() {
  61. out.print(' ');
  62. }
  63.  
  64. public final void run(Reader reader, Writer writer) throws IOException {
  65. this.reader = new BufferedReader(reader);
  66. out = new PrintWriter(writer);
  67. tokenizer = new StringTokenizer("");
  68. separator = System.getProperty("line.separator");
  69. separator = Character.toString(separator.charAt(separator.length() - 1));
  70. solve();
  71. out.flush();
  72. }
  73. }
Add Comment
Please, Sign In to add comment