반응형

카톡방의 홍보로 코드트리라는 알고리즘 공부 사이트를 알게되어

주차별로 완료한 내역과 마지막 문제의 코드를 올립니다.

진단 테스트가 있지만 그냥 훑어본다는 느낌으로 초보단계부터 시작

 

프로그래밍 기초부분 02 입출력 완료

 

문제 - 전화번호 바꾸기

https://www.codetree.ai/missions/4/problems/change-phone-number/description

 

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        sc.useDelimiter("-");

        String f = sc.next();
        int m = sc.nextInt();
        int b = sc.nextInt();

        System.out.printf("%s-%d-%d", f, b, m);
        
               
    }
}
반응형

+ Recent posts