inblog logo
|
silver
    알고리즘문제풀기

    [알고리즘문제풀기] a와 b 출력하기

    silver's avatar
    silver
    Oct 10, 2025
    [알고리즘문제풀기] a와 b 출력하기
    Contents
    문제내가 작성한 정답다른 사람들의 정답

    문제

    school.programmers.co.kr
    https://school.programmers.co.kr/learn/courses/30/lessons/181951

    내가 작성한 정답

    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); } } 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은 포맷 문자열을 지원하지 않고, printf나 format 메서드를 사용 System.out.printf("a = %d \nb = %d",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); sc.close(); } }
    Share article

    silver

    RSS·Powered by Inblog