import java.util.Scanner;

public class Main{

    public static void main(String[] args){

    Scanner sc = new Scanner(System.in);

   

    int test = sc.nextInt();

    int[] arr1 = new int[test];

int[] arr2 = new int[test];

   

    for(int i = 0; i<=test-1;i++) {

   

    arr1 [i]  = sc.nextInt();

    arr2 [i]  = sc.nextInt(); 

   

    if(i==test-1) {

    for(int k = 0; k<=i; k++ ) {

        int j = arr1 [k] + arr2 [k];

        System.out.println(j);

        }

    }

    }   

    }

}


- 배열 생성할 때 [5] 이면 [0]~[4] 가 생성된다. (헷갈리지 말자)

- for 문 안에서 만들어진 변수는 밖에서 사용할 수 없음을 잘 숙지하자

+ Recent posts