BackJoon Algorithm 10953 A+B-6 (Java)

업데이트:
최대 1 분 소요

BackJoon Algorithm - Java

alt

문제

alt

풀이

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

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

        // given
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int Test_count = Integer.parseInt(br.readLine());
        // when
        for (int i = 0; i < Test_count; i++) {
            StringTokenizer token = new StringTokenizer(br.readLine(),",");
            int A = Integer.parseInt(token.nextToken());
            int B = Integer.parseInt(token.nextToken());
            // then
            System.out.println(A+B);
        }
        br.close();

    }
}



댓글남기기