1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String st = sc.next(); int n = sc.nextInt()-1; //chatAt은 0부터 시작하기 때문에 1을 빼줘야 한다. System.out.println(st.charAt(n)); sc.close(); } } | cs |
'Algorithm' 카테고리의 다른 글
백준 문자열 9086 (0) | 2023.08.26 |
---|---|
백준 단어 길이 재기 2743 (0) | 2023.08.26 |
백준 별 찍기 2438 (0) | 2023.08.24 |
백준 알람 45분 빨리 2884 (0) | 2023.08.24 |
백준 과제 안 내신 분 5597 (0) | 2023.08.24 |