MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Java

# [15552/JAVA] ๋น ๋ฅธ A+B

HYEJU01 2021. 9. 4. 20:41
import java.io.*;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
            
            int T = Integer.parseInt(br.readLine());
            
            StringTokenizer st;
            
            for (int i = 0; i < T; i++) {
                st = new StringTokenizer(br.readLine(), " ");
                
                int A = Integer.parseInt(st.nextToken());
                int B = Integer.parseInt(st.nextToken());
                
                bw.write(A+B + "\n");

            }
            bw.flush();
            bw.close();
            br.close();
    }
}

 

 

import java.util.*;
import java.io.*;

public class Main {
public static void main(String[] args)throws IOException{

BufferdReader br = new BufferdReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferdWriter(new OutputStreamWriter(System.out));

int n= Integer.parseInt(br.readLine());

StringTokenizer st; //ํ•œ์ค„๋กœ ๋ฐ›๋„๋ก ์กฐ๊ฑด ์„ค์ •๋จ, split ์ฒ˜๋Ÿผ ์‚ฌ์šฉ๊ฐ€๋Šฅ

for (int i=0; i<n; i++)
{
st = new StirngTokenizer(br.readLine(), " ");

int a= Integer.parseInt(st.nextToken());
int b= Integer.parseInt(st.nextToken());
bw.write(a+b + "\n"); //์ž๋™๊ฐœํ–‰ ๊ธฐ๋Šฅ์ด ์—†๊ธฐ๋•Œ๋ฌธ์— ๊ฐœํ–‰ ํ•„์ˆ˜ 
}
bw.flush(); //๋ฐ์ดํ„ฐ ๋ชจ๋‘ ํ™”๋ฉด์— ์ถœ๋ ฅ
bw.close(); //
br.close();

}
}

์•„๋‹ˆ ์ง„์งœ ๋ชปํ•ด๋จน๊ฐฏ๋„ค Reader ์ด๋ž‘ Writer ๋‹ค์‹œ ๋ฐฐ์šฐ๊ณ  ์˜ค๊ฒ ์๋‹ˆ๋‹ค

 

#R, W ๊ฐœ๋… ์ •๋ฆฌ๋œ ๋ธ”๋กœ๊ทธ 

https://velog.io/@kyukim/%EC%9E%90%EB%B0%94-%EB%B0%B1%EC%A4%80-15552%EB%B2%88-BufferedReader-BufferedWriter