코딩테스트/lv0

[프로그래머스 코딩테스트] java Lv.0 a와 b 출력하기

chantleman 2024. 6. 26. 14:36

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

    
        System.out.println("a = "+a);
        System.out.println("b = "+b);
    }
}

 

scanner system.in을 통해서 입력을 받고 nextInt로 정수 타입 변환 후 system.out으로 출력