백준 10950번 a + b -3(java)

마뇽미뇽·2024년 4월 28일
0

알고리즘 문제풀이

목록 보기
22/165

1.문제
https://www.acmicpc.net/problem/10950

2.풀이
for반복을 할 것은 a+b이고 a와b는 반복동안 값을 입력해야한다.
반복 조건은 테스트 케이스 만큼이다.

3.코드

import java.util.Scanner;

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

        int t = sc.nextInt();
        
        for(int i = 0; i < t; i++){
            int a = sc.nextInt();
            int b = sc.nextInt();
            
            System.out.println(a + b);
        }
    
        sc.close();

    }
}
profile
Que sera, sera

0개의 댓글