happy coding

[java] 10952.a+b-5 본문

coding study/baekjoon

[java] 10952.a+b-5

yeoonii 2023. 4. 5. 15:39

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
    //버퍼 단위로 입력받기
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//조건이 true인 경우 반복 >> 
        while(true) {
        //문자열로 저장하기
            StringTokenizer st = new StringTokenizer(br.readLine());

            int a = Integer.parseInt(st.nextToken());
            int b = Integer.parseInt(st.nextToken());

            if (a == 0 && b == 0) {
                break;
            }
            System.out.println(a + b);
        }
    }
}

'coding study > baekjoon' 카테고리의 다른 글

[java] 10871.배열  (0) 2023.04.08
[java] 10951.a+b-4  (0) 2023.04.05
[java] 8393.합구하기  (0) 2023.04.04
[java] 10950.a+b-3  (0) 2023.04.04
[java] 10869.사칙연산  (0) 2023.04.03
Comments