-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask1.java
45 lines (36 loc) · 1.04 KB
/
Task1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Kornilov Nikita, M3102, 10.09.2020 */
package Sem1.Lab1;
import java.io.*;
import java.util.*;
public class Task1 {
BufferedReader br;
StringTokenizer in;
PrintWriter out;
public static void main(String[] args) {
new Task1().run("aplusb.in", "aplusb.out");
}
public String nextToken() throws IOException {
while (in == null || !in.hasMoreTokens()) {
in = new StringTokenizer(br.readLine());
}
return in.nextToken();
}
public int nextInt() throws IOException {
return Integer.parseInt(nextToken());
}
public void solve() throws IOException {
int a = nextInt(), b = nextInt();
out.print(a + b);
}
public void run(String inputFile, String outputFile) {
try {
br = new BufferedReader(new FileReader(inputFile));
out = new PrintWriter(outputFile);
solve();
out.close();
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
}
}