반응형
카톡방의 홍보로 코드트리라는 알고리즘 공부 사이트를 알게되어
주차별로 완료한 내역과 마지막 문제의 코드를 올립니다.
진단 테스트가 있지만 그냥 훑어본다는 느낌으로 초보단계부터 시작
프로그래밍 기초부분 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);
}
}
반응형
'알고리즘 > 코드트리' 카테고리의 다른 글
[코드트리][Java] 반복문 안의 if - 369 게임 (0) | 2024.08.03 |
---|---|
[코드트리][Java] 반복문 안의 if - a 부터 b 까지 (0) | 2024.08.03 |
[코드트리][Java] if 안의 for - 높은 수에서 낮은 수까지 (0) | 2024.08.02 |
[코드트리][Java] n번 반복하기 - a/b 출력 (0) | 2024.08.01 |
[코드트리 조별과제] 2주차 정리 (0) | 2024.07.28 |