Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1.  
  2. import java.io.*;
  3. import java.util.*;
  4. import static java.lang.Math.*;
  5.  
  6. public class SolutionTemplate implements Runnable {
  7.  
  8.     final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
  9.     BufferedReader in;
  10.     PrintWriter out;
  11.     StringTokenizer tok = new StringTokenizer("");
  12.  
  13.     void init() throws IOException {
  14.         if (ONLINE_JUDGE) {
  15.             in = new BufferedReader(new InputStreamReader(System.in));
  16.             out = new PrintWriter(System.out);
  17.         } else {
  18.             in = new BufferedReader(new FileReader("input.txt"));
  19.             out = new PrintWriter("output.txt");
  20.         }
  21.     }
  22.  
  23.     String readString() throws IOException {
  24.         while (!tok.hasMoreTokens()) {
  25.             tok = new StringTokenizer(in.readLine());
  26.         }
  27.         return tok.nextToken();
  28.     }
  29.  
  30.     int readInt() throws IOException {
  31.         return Integer.parseInt(readString());
  32.     }
  33.  
  34.     public void run() {
  35.         try {
  36.             long t1 = System.currentTimeMillis();
  37.             init();
  38.             solve();
  39.             out.close();
  40.             long t2 = System.currentTimeMillis();
  41.             System.err.println("Time = " + (t2 - t1));
  42.         } catch (Exception e) {
  43.             e.printStackTrace(System.err);
  44.             System.exit(-1);
  45.         }
  46.     }
  47.  
  48.     public static void main(String[] args) {
  49.         new Thread(new SolutionTemplate()).start();
  50.     }
  51.  
  52.     void solve() throws IOException {
  53.         int a = readInt();
  54.         int b = readInt();
  55.         out.print(a + b);
  56.     }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement