https://www.acmicpc.net/problem/27866
27866번: 문자와 문자열
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$)
www.acmicpc.net
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int n = sc.nextInt();
System.out.println(s.charAt(n-1)); // n-1번째 문자를 출력 (맨 앞 문자는 0번째)
}
}