package pack_Array; import java.util.Scanner; public class Sum { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("[입력 값의 누적 구하기]"); int[] question; question = new int[3]; System.out.print("1번째 숫자를 입력하세요 : "); question[0] = scanner.nextInt(); System.out.print("2번째 숫자를 입력하세요 : "); question[1] = scanner.nextInt(); System.out.print("3번째 숫자를 입력하세요 : "); question[2] = scanner.nextInt(); int res = question[0] + question[1] + question[2] ; System.out.println(""); System.out.println("덧셈결과"); System.out.println(question[0] +" + "+ question[1] +" + "+ question[2] +" = "+ res); scanner.close(); } }