🔓Codingtest/0️⃣Lv.0
[프로그래머스] a와 b 출력하기 - Java
청크
2023. 5. 22. 23:08
2023년 05월 22일 월요일
[문제 설명]
정수 a와 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);
}
}
// System.out.println("a = "+a +"\n" +"b = "+b); 한 줄로도 입력이 가능하다.