백준 10951번 A + B - 4 ( java)

마뇽미뇽·2024년 5월 1일
0

알고리즘 문제풀이

목록 보기
32/165

1.문제

https://www.acmicpc.net/problem/10951

2.풀이

EOF 를 사용해야한다.
https://st-lab.tistory.com/40 를 참고하였다.

3.코드

import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNext()){
            int a = sc.nextInt();
            int b = sc.nextInt();
            
            System.out.println(a+b);
        }
        sc.close();
    }
}
profile
Que sera, sera

0개의 댓글