코딩테스트/프로그래머스 Lv. 0

[프로그래머스] Lv. 0 a와 b 출력하기 JAVA

촙오 개발자 2025. 1. 27. 15:37
반응형

a와 b 출력하기

 

문제 설명

 

요구사항

  • 입력받은 두 값 출력 형태에 맞게 출력하기

 

테스트

package lv0;

import java.util.Scanner;

public class a와b_출력하기 {
	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);
	}
}

 

프로그래머스

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

 

결과

반응형