반응형
1. BufferedRead와 BufferedWriter 클래스 사용한 코드
2. BufferedRead 클래스만 사용한 코드
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
|
/*
* Author : Jeonghun Cho
* Date : December 2, 2019
*/
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int size = Integer.parseInt(br.readLine());
for(int i=1; i<=size; i++) {
String[] str = br.readLine().split(" ");
int result = Integer.parseInt(str[0])+Integer.parseInt(str[1]);
}
}
}
Colored by Color Scripter
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/*
* Author : Jeonghun Cho
* Date : December 2, 2019
*/
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int size = Integer.parseInt(br.readLine()); // size
for(int i=1; i<=size; i++) {
String[] str = br.readLine().split(" ");
int result = Integer.parseInt(str[0])+Integer.parseInt(str[1]);
System.out.println("Case #"+i+": "+result);
}
}
}
Colored by Color Scripter
|
반응형
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 2438 별 찍기 - 1 (Java) (0) | 2019.12.02 |
---|---|
[백준] 11022 A+B -8 (Java) (0) | 2019.12.02 |
[백준] 2742 기찍 N (Java) (0) | 2019.12.02 |
[백준] 2741 N찍기 (Java) (0) | 2019.12.02 |
[백준] 15552 빠른 A+B (Java) (0) | 2019.12.02 |