[코딩테스트]프로그래머스 _ a와 b 출력하기

쟈니·2023년 6월 30일
0

코딩테스트 연습 - 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.lineSeparator() + "b = " + b);
    }
}

접근 방식

하나의 출력으로 문장 넘기기를 하기 위해 System.lineSeparator() 사용

후기

System.lineSeparator() 사용

  • 생각해보니 System.out.print()를 사용하여 한줄씩 입력할 수 있다..ㅎ

풀이 참고

profile
시작은 미미하나 끝은 쥬쥬하다.

0개의 댓글