a와 b 출력하기

Programmers 코딩 기초 트레이닝


문제 설명

정수 ab가 주어집니다. 각 수를 입력받아 입력된 값을 그대로 출력하는 코드를 작성해 보세요.

제한사항

  • -100,000 ≤ a, b ≤ 100,000

입출력 예

입력 출력
4 5 a = 4
b = 5

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);
    }
}

출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges

Leave a comment