본문 바로가기

알고리즘/Java

[JAVA] 백준 알고리즘 1단계 1000번 : A+B

 

정수를 입력 받은 후 더한 값을 출력 문제

 

1
2
3
4
5
6
7
8
9
10
11
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        System.out.println(a+b);
    }    
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

Scanner는 java.util 의 클래스로 위에서 import한다.

(Scanner는 자바에서 값을 입력받을 때 사용)